/* ==========================================================================
   Design Tokens
   ========================================================================== */
:root {
  /* Colors */
  --bg-primary: #0a192f;
  --bg-secondary: #112240;
  --bg-card: #1a2744;
  --bg-nav: rgba(10, 25, 47, 0.95);

  --accent: #00d4aa;
  --accent-hover: #00f0c0;
  --accent-dim: rgba(0, 212, 170, 0.15);

  --text-primary: #ccd6f6;
  --text-secondary: #8892b0;
  --text-bright: #e6f1ff;
  --text-link: #64d8cb;

  --border: #233554;
  --shadow: rgba(2, 12, 27, 0.7);

  /* Typography */
  --font-body: 'Inter', 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Ubuntu', 'Inter', sans-serif;
  --font-mono: 'Fira Code', 'Consolas', monospace;

  /* Spacing */
  --section-pad: clamp(3rem, 6vw, 6rem);
  --content-max: 1200px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;
}

/* ==========================================================================
   Base / Reset
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-y: scroll;
  scroll-behavior: smooth;
}

body,
html {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-bright);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
h4 { font-size: clamp(1rem, 2vw, 1.15rem); }

p {
  color: var(--text-primary);
  margin-bottom: 1rem;
}

/* ==========================================================================
   Links
   ========================================================================== */
a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

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

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1.5rem;
  transition: background var(--transition-base);
}

.navbar-brand img {
  border-radius: 50%;
  border: 2px solid var(--accent);
  transition: border-color var(--transition-fast);
}

.navbar-brand img:hover {
  border-color: var(--accent-hover);
}

.navbar-toggler {
  border-color: var(--border);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(204, 214, 246, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.nav-item {
  padding-left: 3px;
  padding-right: 3px;
}

a.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.75rem;
  position: relative;
  transition: color var(--transition-fast);
  background: none;
  -webkit-text-fill-color: unset;
  background-clip: unset;
  -webkit-background-clip: unset;
}

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

.navbar a.nav-link.active {
  color: var(--text-bright) !important;
  text-shadow: 0 0 10px rgba(0, 212, 170, 0.6), 0 0 20px rgba(0, 212, 170, 0.3);
}

a.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width var(--transition-base), left var(--transition-base);
}

a.nav-link:hover::after,
a.nav-link.active::after {
  width: 80%;
  left: 10%;
}

/* Navbar name link */
.navbar-brand-name {
  color: var(--text-bright);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  white-space: nowrap;
  vertical-align: middle;
  line-height: 40px;
}

.navbar-brand:hover .navbar-brand-name {
  color: var(--accent);
}

/* Anchor offset for fixed navbar */
:target {
  scroll-margin-top: 90px;
}

/* Social icons in navbar */
ul.nav.navbar-nav.ml-auto.w-100.justify-content-end {
  display: flex;
  flex-direction: row;
}

.nav-link .fa,
.nav-link .ai {
  color: var(--text-secondary);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.nav-link:hover .fa,
.nav-link:hover .ai {
  color: var(--accent);
  transform: translateY(-2px);
}

/* Navbar collapse custom breakpoint */
@media (min-width: 1500px) {
  .navbar-expand-custom {
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }
  .navbar-expand-custom .navbar-nav {
    flex-direction: row;
  }
  .navbar-expand-custom .dropdown-menu {
    position: absolute;
  }
  .navbar-expand-custom .nav-link {
    padding-right: 0.5rem;
    padding-left: 0.5rem;
  }
  .navbar-expand-custom > .container {
    flex-wrap: nowrap;
  }
  .navbar-expand-custom .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
  }
  .navbar-expand-custom .navbar-toggler {
    display: none;
  }
}

.navbar-collapse.collapse.in {
  display: block !important;
}

/* ==========================================================================
   Avatar
   ========================================================================== */
.avatar {
  border-radius: 50%;
  border: 4px solid var(--accent);
  background-color: var(--bg-secondary);
  box-shadow: 0 0 30px rgba(0, 212, 170, 0.2);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.avatar:hover {
  border-color: var(--accent-hover);
  box-shadow: 0 0 40px rgba(0, 212, 170, 0.35);
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 30px var(--shadow);
  border-color: var(--accent);
}

.card-img-top {
  filter: brightness(0.9);
  transition: filter var(--transition-fast);
}

.card:hover .card-img-top {
  filter: brightness(1);
}

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

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

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  border-radius: 4px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

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

.btn-accent {
  background-color: transparent;
  border: 2px solid var(--accent);
  color: var(--accent);
  padding: 0.5rem 1.5rem;
}

.btn-accent:hover {
  background-color: var(--accent);
  color: var(--bg-primary);
}

/* ==========================================================================
   Collapsibles (Certifications)
   ========================================================================== */
.collapsible {
  background-color: var(--bg-secondary);
  cursor: pointer;
  width: 100%;
  padding: 1rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  color: var(--text-bright);
  font-family: var(--font-heading);
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.collapsible:hover,
.active {
  background-color: var(--bg-card);
  border-color: var(--accent);
}

.content {
  padding: 1.5rem;
  display: none;
  overflow: hidden;
  background: var(--bg-card);
  border-radius: 0 0 8px 8px;
  border: 1px solid var(--border);
  border-top: 0;
}

/* ==========================================================================
   Certification Links & Badges
   ========================================================================== */
.certLink {
  color: var(--text-link);
}

.certLink:hover {
  color: var(--accent-hover);
  text-decoration: none;
}


/* ==========================================================================
   Horizontal Rules
   ========================================================================== */
hr {
  display: block;
  margin-top: 0.5em;
  margin-bottom: 0.5em;
  border: 0;
  height: 1px;
  background: var(--border);
}

/* ==========================================================================
   Layout Helpers
   ========================================================================== */
.row {
  width: 100%;
  margin: 0 auto;
  justify-content: center;
}

.block {
  width: 100px;
}

/* ==========================================================================
   Loading Animation
   ========================================================================== */
.loader-wrapper {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background-color: var(--bg-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.loader-wrapper.loaded {
  opacity: 0;
  pointer-events: none;
}

.loader {
  display: inline-block;
  width: 30px;
  height: 30px;
  position: relative;
  border: 4px solid var(--accent);
  animation: loader 2s infinite ease;
  z-index: 5;
}

.loader-inner {
  vertical-align: top;
  display: inline-block;
  width: 100%;
  background-color: var(--accent);
  animation: loader-inner 2s infinite ease-in;
  z-index: 5;
}

@keyframes loader {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(180deg); }
  50% { transform: rotate(180deg); }
  75% { transform: rotate(360deg); }
  100% { transform: rotate(360deg); }
}

@keyframes loader-inner {
  0% { height: 0%; }
  25% { height: 0%; }
  50% { height: 100%; }
  75% { height: 100%; }
  100% { height: 0%; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  text-align: center;
  width: 100%;
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem;
}

.footer a {
  color: var(--text-link);
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: var(--accent-hover);
}

.footer-slim {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.footer-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.footer-sep {
  margin: 0 0.4rem;
  color: var(--text-secondary);
  opacity: 0.5;
}

.footer-socials {
  display: flex;
  gap: 1rem;
  font-size: 1.15rem;
}

.footer-socials a {
  color: var(--text-secondary);
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.footer-socials a:hover {
  color: var(--accent);
  transform: translateY(-2px);
}

.footer__copyright {
  color: var(--text-secondary);
  font-size: 0.8rem;
  opacity: 0.7;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.text-white { color: var(--text-bright) !important; }
.text-accent { color: var(--accent) !important; }
.text-muted-custom { color: var(--text-secondary) !important; }
.bg-dark-section { background-color: var(--bg-secondary); }
.font-heading { font-family: var(--font-heading); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media screen and (max-width: 768px) {
  body {
    font-size: 15px;
  }
}

@media screen and (max-width: 480px) {
  .nav-item {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ==========================================================================
   Scrollbar (subtle custom)
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

/* ==========================================================================
   Selection highlight
   ========================================================================== */
::selection {
  background: var(--accent);
  color: var(--bg-primary);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-bg::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--accent), transparent);
}

.hero > .container {
  position: relative;
  z-index: 1;
}

.hero-avatar {
  width: clamp(180px, 20vw, 250px);
  height: clamp(180px, 20vw, 250px);
  object-fit: cover;
}

.hero-avatar-wrap {
  margin-bottom: 2rem;
}

.hero-content {
  padding: 1rem 0;
}

.hero-label {
  color: var(--accent);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.hero-name {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  line-height: 1.1;
}

.hero-affiliation {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.hero-interests {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.interest-tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid rgba(0, 212, 170, 0.3);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.interest-tag:hover {
  background: rgba(0, 212, 170, 0.25);
  border-color: var(--accent);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

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

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

@media screen and (max-width: 768px) {
  .hero {
    text-align: center;
    padding-top: 100px;
  }

  .hero-interests {
    justify-content: center;
  }

  .hero-cta {
    justify-content: center;
  }
}

/* ==========================================================================
   Sections
   ========================================================================== */
.section-dark {
  background-color: var(--bg-primary);
  padding: var(--section-pad) 0;
}

.section-alt {
  background-color: var(--bg-secondary);
  padding: var(--section-pad) 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-bright);
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--accent);
  border-radius: 2px;
}

/* ==========================================================================
   Timeline
   ========================================================================== */
.timeline-scroll-outer {
  position: relative;
}

.timeline-scroll-wrap {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
}

.timeline-scroll-wrap::-webkit-scrollbar {
  width: 4px;
}

.timeline-scroll-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.timeline-scroll-wrap::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 2px;
}

.timeline-scroll-fade {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 70px;
  background: linear-gradient(to bottom, transparent, var(--bg-secondary));
  pointer-events: none;
  z-index: 1;
}

.timeline {
  position: relative;
  padding-left: 40px;
  padding-bottom: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}


.timeline-item {
  position: relative;
  padding-bottom: 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -36px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent);
  z-index: 1;
  transition: all var(--transition-fast);
}

.timeline-item:hover .timeline-marker {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(0, 212, 170, 0.4);
}

.timeline-date {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.timeline-content h4 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.5;
}

.timeline-content h4 a {
  color: var(--text-bright);
}

.timeline-content h4 a:hover {
  color: var(--accent);
}

.timeline-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.timeline-tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
}

.tag-service {
  background: rgba(0, 121, 190, 0.15);
  color: #4da8da;
}

.tag-publication {
  background: rgba(0, 212, 170, 0.15);
  color: var(--accent);
}

.tag-cert {
  background: rgba(255, 193, 7, 0.15);
  color: #ffc107;
}

@media screen and (max-width: 576px) {
  .timeline {
    padding-left: 30px;
  }

  .timeline-marker {
    left: -26px;
    width: 10px;
    height: 10px;
  }
}

/* ==========================================================================
   Research Cards
   ========================================================================== */
.research-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem 1.5rem;
  height: 100%;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.research-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-base);
}

.research-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px var(--shadow);
}

.research-card:hover::before {
  transform: scaleX(1);
}

.research-card-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.research-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
}

.research-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0;
  line-height: 1.6;
}

/* ==========================================================================
   Certifications Page
   ========================================================================== */
.cert-intro {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  max-width: 800px;
}

.cert-intro a {
  color: var(--text-link);
}

/* Featured Certification Card */
.cert-featured {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.5rem;
  position: relative;
  overflow: hidden;
}

.cert-featured::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.cert-featured-img {
  max-width: 200px;
  width: 100%;
  transition: transform var(--transition-base);
}

.cert-featured-img:hover {
  transform: scale(1.05);
}

.cert-badge-label {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3em 0.8em;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.cert-featured h2 {
  font-size: 1.5rem;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.cert-meta {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.cert-sub-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.cert-sub-badges img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 6px;
  transition: transform var(--transition-fast);
}

.cert-sub-badges img:hover {
  transform: scale(1.15);
}

/* Certification Cards Grid */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  transition: border-color var(--transition-base), transform var(--transition-base);
}

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

.cert-card-img {
  flex: 0 0 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.15);
}

.cert-card-img img {
  width: 80px;
  height: 80px;
  object-fit: contain;
}

.cert-card-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cert-card-body h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.cert-provider {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 500;
}

.cert-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* TryHackMe Badge Grid */
.thm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1.25rem;
}

.thm-badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.25rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  transition: border-color var(--transition-base), transform var(--transition-base);
}

.thm-badge-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  text-decoration: none;
}

.thm-badge-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 0.75rem;
}

.thm-badge-card span {
  font-size: 0.85rem;
  color: var(--text-bright);
  font-weight: 500;
}

/* Programming Cert Cards */
.prog-cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 2rem;
  height: 100%;
  transition: border-color var(--transition-base), transform var(--transition-base);
}

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

.prog-cert-card h3 {
  font-size: 1.1rem;
  color: var(--text-bright);
  margin-bottom: 1rem;
  font-weight: 600;
}

.prog-cert-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.prog-cert-card li {
  background: var(--accent-dim);
  color: var(--text-primary);
  padding: 0.3em 0.75em;
  border-radius: 4px;
  font-size: 0.85rem;
}

.prog-cert-card li a {
  color: var(--text-link);
  text-decoration: none;
}

.prog-cert-card li a:hover {
  color: var(--accent-hover);
}

@media (max-width: 576px) {
  .cert-grid {
    grid-template-columns: 1fr;
  }
  .thm-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cert-card-img {
    flex: 0 0 80px;
    padding: 0.75rem;
  }
  .cert-card-img img {
    width: 60px;
    height: 60px;
  }
}

/* ==========================================================================
   Page Header (shared across pages)
   ========================================================================== */
.page-header {
  padding-top: 140px;
  padding-bottom: 60px;
  background: var(--bg-primary);
}

.page-header h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  color: var(--text-bright);
  margin-bottom: 0.5rem;
}

.page-header .page-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 700px;
}

/* ==========================================================================
   CV Page
   ========================================================================== */
.cv-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.cv-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-base);
}

.cv-nav a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.cv-nav a img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.cv-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.cv-download-btn:hover {
  background: var(--accent);
  color: var(--bg-primary);
}

/* CV Entry (education, work) */
.cv-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 1.5rem 2rem;
  margin-bottom: 1.25rem;
  transition: border-color var(--transition-base);
}

.cv-entry:hover {
  border-left-color: var(--accent-hover);
}

.cv-entry h3 {
  font-size: 1.15rem;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
}

.cv-entry .cv-role {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
  line-height: 1.6;
}

.cv-entry .cv-role a {
  color: var(--text-link);
}

.cv-entry .cv-date {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.03em;
}

.cv-entry ul {
  margin-top: 0.75rem;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

.cv-entry ul li {
  margin-bottom: 0.3rem;
}

/* Skill Categories */
.skill-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem;
  height: 100%;
}

.skill-category h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.skill-tag {
  background: var(--accent-dim);
  color: var(--text-primary);
  padding: 0.25em 0.7em;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* Language Card */
.lang-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 12px;
  padding: 1.5rem 1rem;
  min-height: 130px;
  height: 100%;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.lang-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 212, 170, 0.15);
}

.lang-card .lang-icon {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.lang-card .lang-name {
  font-size: 1.15rem;
  color: var(--text-bright);
  font-weight: 700;
}

.lang-card .lang-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   Publications Page
   ========================================================================== */
.pub-year {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.pub-year:first-child {
  margin-top: 0;
}

.pub-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 1.25rem 1.75rem;
  margin-bottom: 1rem;
  transition: border-color var(--transition-base), transform var(--transition-base);
}

.pub-entry:hover {
  border-left-color: var(--accent-hover);
  transform: translateX(4px);
}

.pub-entry h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.pub-entry h3 a {
  color: var(--text-bright);
  text-decoration: none;
}

.pub-entry h3 a:hover {
  color: var(--accent);
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.pub-authors .pub-self {
  color: var(--accent);
  font-weight: 600;
}

.pub-venue {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-style: italic;
}

.pub-award {
  display: inline-block;
  margin-top: 0.5rem;
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25em 0.75em;
  border-radius: 4px;
}

/* ==========================================================================
   Research Page
   ========================================================================== */
.research-area {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: 0 0 10px 10px;
  padding: 2rem;
  height: 100%;
  transition: transform var(--transition-base), border-color var(--transition-base);
}

.research-area:hover {
  transform: translateY(-3px);
  border-top-color: var(--accent-hover);
}

.research-area h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

.research-area h3 a {
  color: var(--text-bright);
  text-decoration: none;
}

.research-area h3 a:hover {
  color: var(--accent);
}

.research-area ul {
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 0;
}

.research-area ul li {
  margin-bottom: 0.3rem;
}

.research-collab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.25rem;
}

.research-collab h3 {
  font-size: 1.05rem;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
}

.research-collab ul {
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ==========================================================================
   Service Page
   ========================================================================== */
.service-year {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
  margin-top: 2rem;
}

.service-year:first-child {
  margin-top: 0;
}

.service-entry {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.75rem;
  margin-bottom: 0.75rem;
  transition: border-color var(--transition-base);
}

.service-entry:hover {
  border-color: var(--accent);
}

.service-entry h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.service-entry h3 a {
  color: var(--text-link);
}

.service-entry p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

.award-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid #ffd700;
  border-radius: 0 10px 10px 0;
  padding: 1.25rem 1.75rem;
  margin-bottom: 1rem;
}

.award-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.25rem;
}

.award-card h3 a {
  color: var(--text-link);
}

.award-card .award-label {
  display: inline-block;
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}

.award-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ==========================================================================
   Contact Page
   ========================================================================== */
.contact-hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  padding-top: 120px;
  padding-bottom: 50px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4.5rem 3rem;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.contact-card h1 {
  font-size: 2.5rem;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

.contact-card p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.contact-email {
  display: inline-block;
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 600;
  padding: 0.75rem 2rem;
  border: 2px solid var(--accent);
  border-radius: 8px;
  margin-bottom: 2rem;
  transition: all var(--transition-base);
}

.contact-email:hover {
  background: var(--accent);
  color: var(--bg-primary);
  text-decoration: none;
}

.contact-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.contact-socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 1.25rem;
  transition: all var(--transition-base);
}

.contact-socials a:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-3px);
}

/* ==========================================================================
   Animated Gradient Mesh (Hero)
   ========================================================================== */
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-bg {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(0, 212, 170, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 121, 190, 0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(0, 212, 170, 0.06) 0%, transparent 40%),
    var(--bg-primary);
  background-size: 200% 200%;
  animation: gradient-shift 15s ease infinite;
}

/* ==========================================================================
   Navbar Shrink on Scroll
   ========================================================================== */
.navbar {
  transition: padding var(--transition-base), backdrop-filter var(--transition-base), box-shadow var(--transition-base);
}

.navbar.scrolled {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(2, 12, 27, 0.5);
}

/* ==========================================================================
   Scroll-to-Top Button
   ========================================================================== */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity var(--transition-base), visibility var(--transition-base), transform var(--transition-base), background-color var(--transition-fast);
  z-index: 999;
  box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.scroll-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-top:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(0, 212, 170, 0.5);
}

/* ==========================================================================
   Card Hover Glow
   ========================================================================== */
.research-card:hover,
.cert-card:hover,
.thm-badge-card:hover,
.prog-cert-card:hover {
  box-shadow: 0 8px 30px rgba(0, 212, 170, 0.12);
}

.cv-entry:hover {
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.1);
}

.pub-entry:hover {
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.1);
}

.service-entry:hover {
  box-shadow: 0 4px 20px rgba(0, 212, 170, 0.1);
}

.award-card:hover {
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.1);
}

/* ==========================================================================
   Typewriter Effect (Hero)
   ========================================================================== */
.typewriter-wrapper {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2rem;
  min-height: 1.6em;
}

.typewriter-prefix {
  color: var(--text-secondary);
  font-size: 1.05rem;
  white-space: nowrap;
}

.typewriter-text {
  color: var(--accent);
  font-weight: 600;
  font-size: 1.05rem;
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.2em;
  background: var(--accent);
  margin-left: 2px;
  animation: blink-cursor 0.75s step-end infinite;
  vertical-align: text-bottom;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ==========================================================================
   Scroll Progress Indicator
   ========================================================================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  z-index: 9999;
  transition: none;
  box-shadow: 0 0 8px rgba(0, 212, 170, 0.4);
}

/* ==========================================================================
   Glitch Text Effect (Hero Name)
   ========================================================================== */
.hero-name.glitch {
  position: relative;
  animation: glitch-skew 1s ease forwards;
}

.hero-name.glitch::before,
.hero-name.glitch::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.hero-name.glitch::before {
  color: #0ff;
  animation: glitch-before 1s ease forwards;
  clip-path: polygon(0 0, 100% 0, 100% 35%, 0 35%);
}

.hero-name.glitch::after {
  color: #f0f;
  animation: glitch-after 1s ease forwards;
  clip-path: polygon(0 65%, 100% 65%, 100% 100%, 0 100%);
}

@keyframes glitch-before {
  0%   { transform: translate(0); opacity: 0; }
  10%  { transform: translate(-3px, -2px); opacity: 0.8; }
  20%  { transform: translate(3px, 1px); opacity: 0.6; }
  30%  { transform: translate(-2px, 2px); opacity: 0.7; }
  40%  { transform: translate(2px, -1px); opacity: 0.5; }
  50%  { transform: translate(-1px, 1px); opacity: 0.3; }
  60%  { transform: translate(1px, 0); opacity: 0.2; }
  70%  { transform: translate(0); opacity: 0.1; }
  100% { transform: translate(0); opacity: 0; }
}

@keyframes glitch-after {
  0%   { transform: translate(0); opacity: 0; }
  10%  { transform: translate(3px, 2px); opacity: 0.8; }
  20%  { transform: translate(-3px, -1px); opacity: 0.6; }
  30%  { transform: translate(2px, -2px); opacity: 0.7; }
  40%  { transform: translate(-2px, 1px); opacity: 0.5; }
  50%  { transform: translate(1px, -1px); opacity: 0.3; }
  60%  { transform: translate(-1px, 0); opacity: 0.2; }
  70%  { transform: translate(0); opacity: 0.1; }
  100% { transform: translate(0); opacity: 0; }
}

@keyframes glitch-skew {
  0%   { transform: skew(0deg); }
  10%  { transform: skew(-2deg); }
  20%  { transform: skew(1.5deg); }
  30%  { transform: skew(-1deg); }
  40%  { transform: skew(0.5deg); }
  50%  { transform: skew(0deg); }
  100% { transform: skew(0deg); }
}

/* ==========================================================================
   Custom Cursor Accent (Interactive Elements)
   ========================================================================== */
@media (pointer: fine) {
  .research-card,
  .cert-card,
  .thm-badge-card,
  .prog-cert-card,
  .cv-entry,
  .pub-entry,
  .service-entry,
  .award-card,
  .btn,
  .nav-link,
  .timeline-content a,
  .interest-tag,
  .footer-socials a {
    cursor: pointer;
    position: relative;
  }

  .research-card::after,
  .cert-card::after,
  .thm-badge-card::after,
  .prog-cert-card::after,
  .btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: inherit;
    opacity: 0;
    border: 1.5px solid var(--accent);
    box-shadow: 0 0 15px rgba(0, 212, 170, 0.15), inset 0 0 15px rgba(0, 212, 170, 0.05);
    transition: opacity var(--transition-base);
    pointer-events: none;
  }

  .research-card:hover::after,
  .cert-card:hover::after,
  .thm-badge-card:hover::after,
  .prog-cert-card:hover::after,
  .btn:hover::after {
    opacity: 1;
  }
}

/* ==========================================================================
   Dark / Light Mode Toggle
   ========================================================================== */
.theme-toggle {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  max-width: 36px;
  max-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin-left: 0.5rem;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

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

/* Sun/Moon SVG icons */
.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: var(--text-secondary);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke var(--transition-fast);
}

.theme-toggle:hover svg {
  stroke: var(--accent);
}

.theme-toggle .icon-sun { display: block; }
.theme-toggle .icon-moon { display: none; }

[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* Light Mode Variables */
[data-theme="light"] {
  --bg-primary: #f8f9fc;
  --bg-secondary: #eef1f6;
  --bg-card: #ffffff;
  --bg-nav: rgba(248, 249, 252, 0.95);

  --accent: #00a884;
  --accent-hover: #00c49a;
  --accent-dim: rgba(0, 168, 132, 0.1);

  --text-primary: #3a3f58;
  --text-secondary: #6b7394;
  --text-bright: #1a1f36;
  --text-link: #008a6e;

  --border: #d8dde8;
  --shadow: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
}

[data-theme="light"] .navbar {
  background-color: var(--bg-nav) !important;
}

[data-theme="light"] .navbar-toggler-icon {
  filter: invert(0.5);
}

[data-theme="light"] .hero-bg {
  background: radial-gradient(ellipse at 20% 50%, rgba(0, 168, 132, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 100, 170, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(0, 168, 132, 0.04) 0%, transparent 40%),
    var(--bg-primary);
  background-size: 200% 200%;
  animation: gradient-shift 15s ease infinite;
}

[data-theme="light"] .loader-wrapper {
  background: var(--bg-primary);
}

[data-theme="light"] .loader {
  border-color: var(--border);
}

[data-theme="light"] .loader-inner {
  border-top-color: var(--accent);
}

[data-theme="light"] .scroll-progress {
  box-shadow: 0 0 8px rgba(0, 168, 132, 0.3);
}

[data-theme="light"] .interest-tag {
  background: var(--accent-dim);
  color: var(--accent);
  border-color: rgba(0, 168, 132, 0.2);
}

[data-theme="light"] .timeline::before {
  background: var(--border);
}

[data-theme="light"] .timeline-marker {
  border-color: var(--accent);
  background: var(--bg-primary);
}

[data-theme="light"] .timeline-scroll-fade {
  background: linear-gradient(to bottom, transparent, var(--bg-secondary));
}

[data-theme="light"] .footer {
  background: #e8ecf2;
}

[data-theme="light"] .scroll-top {
  box-shadow: 0 4px 15px rgba(0, 168, 132, 0.25);
}

[data-theme="light"] .page-header {
  background: var(--bg-secondary);
}

/* ==========================================================================
   View Transitions API
   ========================================================================== */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.3s;
  animation-timing-function: ease;
}

/* ==========================================================================
   Prefers Reduced Motion
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .hero-bg {
    animation: none;
  }

  .typewriter-cursor {
    animation: none;
    opacity: 1;
  }

  .scroll-top {
    transition: none;
  }

  .hero-name.glitch::before,
  .hero-name.glitch::after {
    display: none;
  }

  .hero-name.glitch {
    animation: none;
  }

}
