/* ──────────────────────────────────────────
   Variables & Reset
────────────────────────────────────────── */
:root {
  --hero-bg:      #0A0F1E;
  --hero-bg2:     #111827;
  --accent:       #C41E3A;
  --accent-hover: #a81831;
  --section-alt:  #F7F8FC;
  --white:        #ffffff;
  --text-1:       #1A202C;
  --text-2:       #4A5568;
  --text-3:       #718096;
  --text-light:   #F7FAFC;
  --border:       #E2E8F0;
  --card-shadow:  0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.05);
  --card-shadow-hover: 0 4px 12px rgba(0,0,0,.12), 0 12px 32px rgba(0,0,0,.1);
  --radius:       12px;
  --nav-h:        68px;
  --ease:         0.3s ease;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-1);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; transition: color var(--ease); }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* ──────────────────────────────────────────
   Layout
────────────────────────────────────────── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 96px 0; }
.section-alt { background: var(--section-alt); }

.section-title {
  font-size: clamp(1.75rem, 4vw, 2.2rem);
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 10px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 44px;
  height: 3px;
  background: var(--accent);
  margin-top: 10px;
  border-radius: 2px;
}

.section-subtitle {
  color: var(--text-2);
  font-size: 1.05rem;
  margin-bottom: 48px;
  margin-top: 6px;
}

/* ──────────────────────────────────────────
   Buttons
────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: .93rem;
  font-weight: 600;
  letter-spacing: .2px;
  border: 2px solid transparent;
  transition: all var(--ease);
}

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

.btn-secondary {
  background: transparent;
  color: rgba(255,255,255,.85);
  border-color: rgba(255,255,255,.35);
}
.btn-secondary:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.7);
  color: var(--white);
}

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

.btn-full { width: 100%; justify-content: center; }

/* ──────────────────────────────────────────
   Navigation
────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 999;
  height: var(--nav-h);
  transition: background var(--ease), box-shadow var(--ease);
}

.navbar.scrolled {
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 16px rgba(0,0,0,.08);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 3px;
  transition: color var(--ease);
}
.navbar.scrolled .nav-logo { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}

.nav-links a {
  color: rgba(255,255,255,.8);
  font-size: .875rem;
  font-weight: 500;
  letter-spacing: .3px;
  position: relative;
  transition: color var(--ease);
}
.navbar.scrolled .nav-links a { color: var(--text-2); }

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
  transition: width var(--ease);
}
.nav-links a:hover::after,
.nav-links a.active::after { width: 100%; }

.nav-links a:hover,
.navbar.scrolled .nav-links a:hover { color: var(--accent); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--ease);
}
.navbar.scrolled .hamburger span { background: var(--text-1); }

/* ──────────────────────────────────────────
   Hero
────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(135deg, #0A0F1E 0%, #131d35 55%, #0d1117 100%);
  display: flex;
  align-items: center;
  overflow: hidden;
}

#particle-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: .55;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1080px;
  margin: 0 auto;
  padding: calc(var(--nav-h) + 40px) 24px 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 56px;
  width: 100%;
}

.hero-text { flex: 1; max-width: 600px; }

.hero-greeting {
  color: var(--accent);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeUp .7s ease .1s forwards;
}

.hero-name {
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  font-weight: 700;
  color: var(--white);
  line-height: 1.1;
  margin-bottom: 10px;
  opacity: 0;
  animation: fadeUp .7s ease .25s forwards;
}

.hero-title {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: rgba(255,255,255,.6);
  font-weight: 400;
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp .7s ease .4s forwards;
}

.hero-description {
  font-size: 1rem;
  color: rgba(255,255,255,.55);
  line-height: 1.85;
  margin-bottom: 28px;
  opacity: 0;
  animation: fadeUp .7s ease .55s forwards;
}
.hero-description strong { color: rgba(255,255,255,.88); }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp .7s ease .7s forwards;
}

.hero-link {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(255,255,255,.62);
  font-size: .88rem;
  font-weight: 500;
  transition: color var(--ease);
}
.hero-link i { font-size: 1rem; }
.hero-link:hover { color: var(--accent); }

.hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp .7s ease .85s forwards;
}

/* Profile image */
.hero-image {
  flex-shrink: 0;
  opacity: 0;
  animation: fadeIn .9s ease .5s forwards;
}

.profile-image-wrapper {
  position: relative;
  width: 270px;
  height: 270px;
  border-radius: 50%;
  border: 3px solid rgba(196,30,58,.45);
  box-shadow: 0 0 60px rgba(196,30,58,.18), 0 0 0 12px rgba(196,30,58,.06);
  overflow: hidden;
  background: var(--hero-bg2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-initials {
  position: absolute;
  font-size: 4rem;
  font-weight: 700;
  color: rgba(255,255,255,.15);
  letter-spacing: 4px;
  pointer-events: none;
}

.profile-image-wrapper.has-photo .profile-initials { display: none; }

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2.2s ease-in-out infinite;
}
.scroll-indicator a {
  color: rgba(255,255,255,.4);
  font-size: 1.3rem;
  transition: color var(--ease);
}
.scroll-indicator a:hover { color: rgba(255,255,255,.8); }

/* ──────────────────────────────────────────
   About
────────────────────────────────────────── */
.about-text {
  max-width: 780px;
  margin-top: 40px;
}

.about-text p {
  color: var(--text-2);
  font-size: 1.02rem;
  line-height: 1.85;
  margin-bottom: 18px;
}
.about-text strong { color: var(--text-1); font-weight: 600; }

.about-hobbies {
  color: var(--text-3) !important;
  font-size: .95rem !important;
  margin-top: 8px;
}
.about-hobbies span {
  display: inline-block;
  white-space: nowrap;
}

/* ──────────────────────────────────────────
   Publications
────────────────────────────────────────── */
.publications {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 48px;
}

.pub-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 30px;
  position: relative;
  overflow: hidden;
  transition: box-shadow var(--ease), transform var(--ease);
}

.pub-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--border);
  transition: background var(--ease);
}

.pub-card:hover,
.pub-card.featured {
  box-shadow: var(--card-shadow-hover);
}
.pub-card:hover { transform: translateX(4px); }

.pub-card:hover::before,
.pub-card.featured::before { background: var(--accent); }

.pub-meta { margin-bottom: 10px; }

.pub-venue {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
}
.pub-venue.aaai  { background: #fff0f2; color: #b5162f; }
.pub-venue.bmvc  { background: #f0f0ff; color: #4040c0; }
.pub-venue.ral   { background: #f0fff4; color: #276749; }
.pub-venue.wacv  { background: #fffaf0; color: #b7791f; }

.pub-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.55;
  margin-bottom: 8px;
}

.pub-authors {
  font-size: .875rem;
  color: var(--text-3);
  margin-bottom: 14px;
  line-height: 1.6;
}
.pub-authors strong { color: var(--text-2); }

.pub-links { display: flex; gap: 14px; }

.pub-link {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  font-size: .82rem;
  font-weight: 600;
  transition: opacity var(--ease);
}
.pub-link:hover { opacity: .72; }

.view-more { text-align: center; margin-top: 40px; }

/* ──────────────────────────────────────────
   Timeline (Experience)
────────────────────────────────────────── */
.timeline {
  position: relative;
  margin-top: 48px;
  padding-left: 28px;
}

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

.timeline-item {
  position: relative;
  margin-bottom: 40px;
}

.timeline-marker {
  position: absolute;
  left: -36px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--white);
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-body {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--ease);
}
.timeline-body:hover { box-shadow: var(--card-shadow-hover); }

.timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.timeline-head h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-1);
}

.timeline-head h4 {
  font-size: .9rem;
  color: var(--text-2);
  font-weight: 400;
  margin-top: 2px;
}

.timeline-date {
  font-size: .82rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.timeline-list {
  margin: 12px 0 16px;
  padding-left: 0;
}

.timeline-list li {
  font-size: .9rem;
  color: var(--text-2);
  line-height: 1.7;
  padding-left: 18px;
  position: relative;
  margin-bottom: 6px;
}

.timeline-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-size: .8rem;
  top: 2px;
}

/* ──────────────────────────────────────────
   Tags (shared)
────────────────────────────────────────── */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tags span {
  background: var(--section-alt);
  color: var(--text-2);
  padding: 4px 11px;
  border-radius: 5px;
  font-size: .76rem;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: all var(--ease);
}

.tags span:hover {
  background: rgba(196,30,58,.06);
  border-color: rgba(196,30,58,.3);
  color: var(--accent);
}

.tags span.highlight {
  background: rgba(196,30,58,.06);
  border-color: rgba(196,30,58,.25);
  color: var(--accent);
}

/* ──────────────────────────────────────────
   Education
────────────────────────────────────────── */
.edu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  margin-top: 48px;
}

.edu-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  gap: 18px;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--ease), transform var(--ease);
}
.edu-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-3px);
}

.edu-logo {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border);
}

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

.edu-logo--nus     { background: #fff; }
.edu-logo--bilkent { background: #fff; }
.edu-logo--kal     { background: #fff; }

.edu-info h3 {
  font-size: .97rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
}
.edu-info h4 {
  font-size: .875rem;
  color: var(--text-2);
  font-weight: 400;
  margin-bottom: 8px;
}

.edu-date {
  display: block;
  font-size: .8rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

.edu-awards { display: flex; flex-direction: column; gap: 5px; }

.edu-awards li {
  font-size: .8rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 7px;
}
.edu-awards li i { color: var(--accent); font-size: .7rem; }

/* ──────────────────────────────────────────
   Skills
────────────────────────────────────────── */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.skill-cat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--card-shadow);
}

.skill-cat h3 {
  font-size: .9rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.skill-cat h3 i { color: var(--accent); width: 18px; }

/* ──────────────────────────────────────────
   Projects
────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 22px;
  margin-top: 48px;
}

.project-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--ease), transform var(--ease);
}
.project-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-4px);
}

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-icon {
  font-size: 1.7rem;
  color: var(--accent);
}

.project-gh {
  color: var(--text-3);
  font-size: 1.25rem;
  transition: color var(--ease);
}
.project-gh:hover { color: var(--accent); }

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

.project-card p {
  font-size: .9rem;
  color: var(--text-2);
  line-height: 1.75;
}

.project-award {
  font-size: .8rem;
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
}

/* ──────────────────────────────────────────
   Interests
────────────────────────────────────────── */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 48px;
}

.interest-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px 22px;
  text-align: center;
  box-shadow: var(--card-shadow);
  transition: box-shadow var(--ease), transform var(--ease);
}
.interest-card:hover {
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-5px);
}

.interest-icon {
  display: block;
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.interest-card h3 {
  font-size: .93rem;
  font-weight: 600;
  color: var(--text-1);
}

.interest-card p {
  font-size: .85rem;
  color: var(--text-3);
  line-height: 1.75;
}

/* ──────────────────────────────────────────
   Contact
────────────────────────────────────────── */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 60px;
  align-items: start;
  margin-top: 48px;
}

.contact-info { display: flex; flex-direction: column; gap: 18px; }

.contact-item {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-2);
  font-size: .93rem;
  transition: color var(--ease);
}
.contact-item i { color: var(--accent); font-size: 1.05rem; width: 20px; flex-shrink: 0; }
.contact-item:hover:not(.contact-item--plain) { color: var(--accent); }
.contact-item--plain { cursor: default; }

.contact-form { display: flex; flex-direction: column; gap: 14px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: .93rem;
  color: var(--text-1);
  background: var(--white);
  transition: border-color var(--ease), box-shadow var(--ease);
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(196,30,58,.08);
}

.contact-form input::placeholder,
.contact-form textarea::placeholder { color: #a0aec0; }

.contact-form textarea { resize: vertical; min-height: 128px; }

/* ──────────────────────────────────────────
   Footer
────────────────────────────────────────── */
.footer {
  background: var(--hero-bg);
  padding: 30px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.footer p { color: rgba(255,255,255,.35); font-size: .84rem; }

.footer-links { display: flex; gap: 18px; }
.footer-links a {
  color: rgba(255,255,255,.35);
  font-size: 1.1rem;
  transition: color var(--ease);
}
.footer-links a:hover { color: var(--accent); }

/* ──────────────────────────────────────────
   Scroll Reveal
────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .55s ease, transform .55s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ──────────────────────────────────────────
   Expandable sections
────────────────────────────────────────── */
.expandable-items {
  overflow: hidden;
  max-height: 0;
  transition: max-height .45s ease;
}
.expandable-items.open {
  max-height: 3000px; /* large enough for any content */
}

/* publications uses flex column — give extra gap at top when open */
.publications .expandable-items { display: flex; flex-direction: column; gap: 18px; }
.publications .expandable-items:not(.open) { gap: 0; }

/* timeline uses block flow — add top margin when open */
.timeline .expandable-items.open { margin-top: 0; }

.expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--ease);
}
.expand-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.expand-icon {
  font-size: .75rem;
  transition: transform var(--ease);
}
.expand-btn.open .expand-icon { transform: rotate(180deg); }

/* ──────────────────────────────────────────
   Animations
────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: none; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(-9px); }
}

/* ──────────────────────────────────────────
   Responsive
────────────────────────────────────────── */
@media (max-width: 860px) {
  .hero-content {
    flex-direction: column-reverse;
    align-items: center;
    text-align: center;
  }
  .hero-links, .hero-cta { justify-content: center; }
  .hero-image { margin-bottom: 8px; }
  .profile-image-wrapper { width: 200px; height: 200px; }

  .about-text { max-width: 100%; }

  .contact-layout { grid-template-columns: 1fr; gap: 36px; }

  .hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: rgba(255,255,255,.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 18px 24px;
    gap: 18px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,.09);
  }
  .nav-links.open { display: flex; }
  .nav-links a { color: var(--text-2) !important; font-size: .95rem; }
}

@media (max-width: 560px) {
  .section { padding: 72px 0; }
  .section-title { font-size: 1.65rem; }
  .timeline { padding-left: 20px; }
  .timeline-marker { left: -29px; }
  .timeline-head { flex-direction: column; gap: 2px; }
  .footer-inner { flex-direction: column; text-align: center; }
}
