:root{
  --bg:#111111;
  --card:#2a2a2a;
  --text:#ffffff;
  --muted:#cccccc;
  --border:#333333;
  --accent:#e20613;
}

*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family: 'Nirmala UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* Scroll Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
}

.section > .container > * {
  opacity: 0;
}

.hero > .container > * {
  opacity: 1;
}

.section.visible > .container > * {
  animation: fadeInUp 0.6s ease-out forwards;
}

.section.visible > .container > *:nth-child(1) { animation-delay: 0.1s; }
.section.visible > .container > *:nth-child(2) { animation-delay: 0.2s; }
.section.visible > .container > *:nth-child(3) { animation-delay: 0.3s; }
.section.visible > .container > *:nth-child(4) { animation-delay: 0.4s; }

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

.container{
  width: min(1000px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header{
  position: sticky;
  top:0;
  background: rgba(0,0,0,.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}

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

.brand{
  font-weight: 700;
  color: var(--text);
}

.nav{ display:flex; gap:16px; align-items:center; }
.nav a{ color: var(--text); opacity:.9; }
.nav a:hover{ opacity:1; }

.btn{
  display:inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color:#ffffff;
  font-weight: 600;
}
.btn:hover{ text-decoration:none; filter: brightness(1.05); }

.btn-ghost{
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
}

.hero{ padding: 70px 0 40px; }
.hero h1{ font-size: clamp(28px, 4vw, 44px); margin:0 0 10px; }
.lead{ color: var(--muted); font-size: 1.05rem; margin:0 0 18px; }

.hero-layout{
  display: grid;
  grid-template-columns: 1fr 250px;
  gap: 40px;
  align-items: center;
}
@media (max-width: 800px){
  .hero-layout{ 
    grid-template-columns: 1fr;
    text-align: center;
  }
}

.hero-photo img{
  width: 100%;
  height: 250px;
  object-fit: contain;
  border-radius: 50%;
  border: none;
}
@media (max-width: 800px){
  .hero-photo img{
    width: 200px;
    height: 200px;
    margin: 0 auto;
    display: block;
    border-radius: 50%;
  }
}

.hero-actions{ display:flex; gap:12px; flex-wrap:wrap; margin-bottom: 18px; }
.links{ display:flex; gap:14px; flex-wrap:wrap; color: var(--muted); }
.links a{ display: inline-block; }
.social-logo{ 
  height: 32px; 
  width: auto; 
  transition: transform 0.2s ease, opacity 0.2s ease, filter 0.2s ease; 
  display: inline-block;
  filter: brightness(0) saturate(100%) invert(13%) sepia(95%) saturate(7471%) hue-rotate(359deg) brightness(98%) contrast(113%);
}
.social-logo:hover{ 
  transform: translateY(-3px); 
  filter: brightness(0) saturate(100%) invert(13%) sepia(95%) saturate(7471%) hue-rotate(359deg) brightness(103%) contrast(113%);
}

.section{ padding: 46px 0; border-top: 1px solid var(--border); }
.section h2{ margin:0 0 18px; font-size: 2.2rem; text-align: center; }

.grid{
  display:grid;
  grid-template-columns: repeat( auto-fit, minmax(240px, 1fr) );
  gap: 16px;
}

.card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.card h3{ margin:0 0 8px; }
.meta{ color: var(--muted); margin: 10px 0 0; }
.card-actions{ margin-top: 12px; display:flex; gap:12px; flex-wrap:wrap; }

.articles-header{
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.articles-header h2{
  margin: 0;
}

.articles-filter{
  display: flex;
  gap: 8px;
}

.filter-btn{
  padding: 10px 16px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.2s;
}

.filter-btn:hover{
  background: var(--border);
}

.filter-btn.active{
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.articles-section{
  display: none;
}

.articles-section.active{
  display: block;
}

.articles-grid{
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 0;
}
@media (max-width: 800px){
  .article-card{
    grid-template-columns: 1fr;
  }
}

.article-card:hover{
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.article-screenshot{
  width: 100%;
  height: 100%;
  min-height: 200px;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

.article-screenshot img{
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #ffffff;
}

.citation-badge{
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
}

.citation-badge:hover{
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  text-decoration: none;
}

.citation-count{
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.citation-label{
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.article-content{
  padding: 16px;
}

.article-content h3{
  margin: 0 0 10px;
  font-size: 1.15rem;
  line-height: 1.4;
}

.authors{
  color: var(--muted);
  margin: 0 0 6px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.authors strong{
  color: var(--text);
  font-weight: 600;
}

.author-mail-icon{
  width: 14px;
  height: 14px;
  margin-left: 6px;
  vertical-align: middle;
  display: inline-block;
  filter: brightness(0) saturate(100%) invert(80%) sepia(0%) saturate(0%) hue-rotate(0deg) brightness(80%) contrast(80%);
}

.list{ margin:0; padding-left: 18px; }
.list li{ margin: 10px 0; color: var(--text); }
.list li a{ margin-left: 8px; }

.projects-list{
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-item{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
}

.project-title{
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-title::-webkit-details-marker{
  display: none;
}

.project-title::before{
  content: "▶";
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
  transition: transform 0.2s;
}

.project-item[open] .project-title::before{
  content: "▼";
}

.project-details{
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 16px 0;
  color: var(--muted);
  line-height: 1.5;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out, opacity 0.3s ease-out, padding 0.4s ease-out;
}

.project-item[open] .project-details{
  max-height: 1000px;
  opacity: 1;
  padding: 0 16px 12px;
}

.project-details a{
  color: var(--accent);
}

@media (max-width: 800px){
  .project-details{
    flex-direction: column;
  }
}

.two-col{
  display:grid;
  grid-template-columns: 1.2fr .8fr;
  gap:16px;
}
@media (max-width: 800px){
  .two-col{ grid-template-columns: 1fr; }
}

.about-layout{
  display:grid;
  grid-template-columns: 1fr 450px;
  gap:16px;
  align-items: start;
}
.about-layout > .card {
  background: transparent;
  border: none;
  padding: 0;
}
.about-layout > .skills-sidebar {
  background: transparent;
  border: none;
  padding: 0;
}
.about-layout h3 {
  margin: 0 0 8px;
}
@media (max-width: 800px){
  .about-layout{ grid-template-columns: 1fr; }
}

.professional_career-sidebar{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  height: fit-content;
}

.professional_career-sidebar h3{ margin:0 0 12px; }

/* Professional Career Styles */
.career-timeline {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.career-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.career-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.career-logo {
  width: 60px;
  height: 60px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.career-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.career-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.career-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.career-company {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.3;
}

.career-period {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.3;
}

.career-location {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.3;
}

.career-description {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
}

.tags{
  list-style:none;
  padding:0;
  margin:0;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.tags li{
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--muted);
}

.site-footer{
  border-top: 1px solid var(--border);
  padding: 18px 0;
  color: var(--muted);
  text-align:center;
}

/* Timeline Styles */
.timeline {
  position: relative;
  padding: 320px 0 450px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 3px;
  background: linear-gradient(to right, transparent, var(--accent));
  z-index: 1;
}

.timeline-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 120px;
  font-size: 0.95rem;
}

.timeline-marker {
  position: relative;
  z-index: 2;
  width: 40px;
  height: 40px;
  background: var(--card);
  border: 3px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--accent);
  font-size: 0.85rem;
}

.timeline-date {
  display: block;
}

.timeline-content {
  position: relative;
  width: 100%;
}

.timeline-tooltip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  transition: all 0.3s ease;
  position: absolute;
  left: 50%;
  z-index: 10;
  min-width: 280px;
  max-width: 340px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  pointer-events: auto;
  margin-left: -140px;
}

/* Odd items: content above timeline */
.timeline-item:nth-child(odd) .timeline-tooltip {
  bottom: 80px;
  transform-origin: center bottom;
}

.timeline-item:nth-child(odd) .timeline-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--card);
}

/* Even items: content below timeline */
.timeline-item:nth-child(even) .timeline-tooltip {
  top: 100px;
  transform-origin: center top;
}

.timeline-item:nth-child(even) .timeline-tooltip::after {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--card);
}

.timeline-item:hover .timeline-tooltip {
  transform: translateY(0) scale(1.05);
}

.tooltip-images {
  width: 100%;
  height: 160px;
  overflow: hidden;
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--bg);
}

.tooltip-images img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tooltip-text h4 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}

.tooltip-text p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.timeline-item:hover .tooltip-text p {
  max-height: 200px;
  opacity: 1;
  margin-top: 8px;
}

/* Timeline hover indicator */
.timeline-item:hover .timeline-marker {
  transform: scale(1.2);
  box-shadow: 0 0 0 8px rgba(250, 128, 114, 0.1);
}

@media (max-width: 1024px) {
  .timeline {
    flex-wrap: wrap;
    padding: 280px 0 450px;
  }

  .timeline-item {
    flex: 0 1 calc(50% - 8px);
  }

  .timeline::before {
    display: none;
  }
}

@media (max-width: 768px) {
  .timeline {
    flex-direction: column;
    padding: 20px 0;
  }

  .timeline::before {
    left: 20px;
    right: auto;
    top: 0;
    bottom: 0;
    transform: none;
    width: 3px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent), transparent);
  }

  .timeline-item {
    align-items: flex-start;
    margin-left: 50px;
    margin-bottom: 30px;
    position: relative;
  }
  
  .timeline-item:last-child {
    margin-bottom: 0;
  }

  .timeline-marker {
    position: absolute;
    left: -55px;
    top: 0;
  }

  .timeline-tooltip {
    position: static;
    margin-left: 0;
    transform: translateY(0) scale(1);
    margin-top: 50px;
  }

  .timeline-tooltip::after,
  .timeline-item:nth-child(odd) .timeline-tooltip::after,
  .timeline-item:nth-child(even) .timeline-tooltip::after {
    display: none;
  }

  .timeline-item:hover .timeline-tooltip {
    transform: translateY(0) scale(1.05);
  }

  .timeline-tooltip {
    min-width: 260px;
  }
}

@media (max-width: 480px) {
  .timeline {
    padding: 20px 0;
  }

  .timeline-item {
    margin-left: 40px;
    margin-bottom: 30px;
  }
  
  .timeline-item:last-child {
    margin-bottom: 0;
  }

  .timeline-marker {
    left: -45px;
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
    border-width: 2px;
    top: 0;
  }

  .timeline::before {
    left: 12px;
  }

  .timeline-tooltip {
    min-width: calc(100vw - 80px);
    position: static;
    transform: translateY(0) scale(1);
    margin-top: 40px;
  }

  .tooltip-images {
    height: 140px;
  }
  
  .timeline-item:hover .timeline-tooltip {
    transform: translateY(0) scale(1.05);
  }
}

