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

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #e5e7eb;
  background: radial-gradient(circle at top, #1e293b 0, #020617 55%, #020617 100%);
  line-height: 1.6;
}

/* ----- Layout Helpers ----- */
.container {
  width: min(1120px, 100% - 2.5rem);
  margin: 0 auto;
}

.section {
  padding: 4rem 0;
}

.section-alt {
  background: radial-gradient(circle at top, #020617 0, #020617 40%, #020617 100%);
}

.section h2 {
  font-size: 2.1rem;
  margin-bottom: 0.75rem;
  text-align: center;
  color: #60a5fa;
}

.section-sub {
  color: #9ca3af;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ----- Top Nav ----- */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #1f2937;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 0;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6366f1, #a855f7, #22d3ee);
  color: #f9fafb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.logo-text {
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #e5e7eb;
}

.nav-links {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: #9ca3af;
  font-size: 0.95rem;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2rem;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #60a5fa, #a855f7, #22d3ee);
  transition: width 0.2s ease;
}

.nav-links a:hover {
  color: #e5e7eb;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid #374151;
  border-radius: 0.5rem;
  font-size: 1.2rem;
  padding: 0.2rem 0.6rem;
  color: #e5e7eb;
}

/* ----- HERO (AITHORS-like) ----- */
.hero {
  padding: 4.5rem 0 3rem;
  text-align: center;
}

.hero-main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.avatar-wrapper {
  width: 140px;
  height: 140px;
  border-radius: 999px;
  overflow: hidden;
}

.hero-avatar-ring {
  padding: 4px;
  background: linear-gradient(135deg, #6366f1, #a855f7, #22d3ee);
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.hero-name-gradient {
  font-size: 3.2rem;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(90deg, #6366f1, #a855f7, #22d3ee);
  -webkit-background-clip: text;
  color: transparent;
}

.hero-tagline {
  color: #d1d5db;
  margin-bottom: 0.2rem;
  font-size: 1.25rem;
  min-height: 1.5em;
}

.hero-location {
  color: #9ca3af;
  margin-bottom: 1.4rem;
  font-size: 0.98rem;
}

/* typewriter cursor */
.typing-cursor {
  display: inline-block;
  margin-left: 4px;
  width: 2px;
  background: #e5e7eb;
  animation: blink 0.8s steps(1) infinite;
  height: 1.2em;
  vertical-align: bottom;
}

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

/* buttons – hero + code */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-main-cta {
  background: linear-gradient(90deg, #3b82f6, #a855f7);
  color: #f9fafb;
  box-shadow: 0 18px 45px rgba(79, 70, 229, 0.6);
}

.btn-main-cta:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 22px 60px rgba(79, 70, 229, 0.8);
}

/* Code buttons gradient */
.btn-code {
  background: linear-gradient(90deg, #6366f1, #ec4899);
  color: #ffffff;
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  box-shadow: 0 10px 26px rgba(79, 70, 229, 0.6);
}

.btn-code:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 14px 34px rgba(79, 70, 229, 0.85);
}

.btn-icon {
  margin-right: 0.4rem;
  display: flex;
  align-items: center;
}

.full-width {
  width: 100%;
}

/* hero socials – round circles under button */
.hero-socials-icons {
  display: flex;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.social-circle {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.9);
  font-size: 1.15rem;
}

.social-circle:hover {
  border-color: #a855f7;
  color: #ffffff;
}

/* about bubble under hero */
.hero-about-card {
  margin: 3rem auto 0;
  max-width: 720px;
  background: #020617;
  border-radius: 1.5rem;
  padding: 1.7rem 2rem;
  border: 1px solid #1f2937;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.75);
  color: #d1d5db;
  text-align: left;
  font-size: 0.98rem;
}

/* scroll arrow under each section */
.section-scroll {
  margin-top: 2.3rem;
  text-align: center;
}

.scroll-arrow-btn {
  display: inline-block;
  font-size: 1.6rem;
  color: #60a5fa;
  background: transparent;
  border: none;
  cursor: pointer;
  animation: arrow-bounce 1.4s ease-in-out infinite;
}

.scroll-arrow-btn:hover {
  color: #93c5fd;
}

/* small up–down motion */
@keyframes arrow-bounce {
  0% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(7px);
    opacity: 1;
  }
  60% {
    transform: translateY(14px);
    opacity: 0.8;
  }
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
}

/* ----- GitHub icon styles ----- */
.icon-github {
  width: 18px;
  height: 18px;
  fill: #9ca3af;
}

.social-circle .icon-github {
  width: 18px;
  height: 18px;
}

.btn-code .icon-github {
  width: 16px;
  height: 16px;
  fill: #ffffff;
}

.social-circle:hover .icon-github,
.contact-icon:hover .icon-github {
  fill: #ffffff;
}

/* ----- Cards (Projects) ----- */
.card-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2.1rem;
}

.projects-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.card {
  background: radial-gradient(circle at top left, #111827, #020617);
  border-radius: 1.25rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid #1f2937;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.85);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.card h3 {
  font-size: 1.05rem;
  color: #e5e7eb;
}

.card-subtitle {
  color: #a855f7;
  font-size: 0.8rem;
  font-weight: 600;
}

.card-tagline {
  color: #9ca3af;
  font-size: 0.88rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: #1f2937;
  border: 1px solid #27272a;
  color: #e5e7eb;
}

.card-links {
  margin-top: 0.7rem;
}

.card-more {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ----- Timeline ----- */
.timeline {
  position: relative;
  margin-top: 2rem;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: linear-gradient(to bottom, #22d3ee, #6366f1);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin: 1.5rem 0;
  display: flex;
  justify-content: flex-start;
}

.timeline-item:nth-child(odd) .timeline-card {
  margin-left: 52%;
}

.timeline-item:nth-child(even) .timeline-card {
  margin-right: 52%;
  margin-left: 0;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  width: 12px;
  height: 12px;
  background: #0ea5e9;
  border-radius: 999px;
  border: 2px solid #020617;
  transform: translate(-50%, 4px);
}

.timeline-card {
  background: #020617;
  border-radius: 1.1rem;
  padding: 1.2rem 1.4rem;
  border: 1px solid #1f2937;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.7);
  width: 46%;
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.timeline-pill {
  padding: 0.1rem 0.65rem;
  border-radius: 999px;
  border: 1px solid #22d3ee;
  font-size: 0.75rem;
  color: #22d3ee;
}

.timeline-company {
  color: #22d3ee;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.timeline-body {
  color: #9ca3af;
  font-size: 0.88rem;
}

/* ----- Publications (Row) ----- */
.pub-list {
  margin-top: 2rem;
}

.pub-row {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.pub-item {
  background: #020617;
  border-radius: 1.1rem;
  padding: 1.3rem 1.4rem;
  border: 1px solid #14532d;
  min-width: 320px;
  flex: 1 0 45%;
  max-width: 520px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.85);
}

.pub-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #22c55e;
  color: #22c55e;
  font-size: 0.75rem;
  margin-bottom: 0.5rem;
}

.pub-title {
  font-size: 1rem;
  color: #e5e7eb;
  margin-bottom: 0.2rem;
}

.pub-meta {
  font-size: 0.85rem;
  color: #22c55e;
  margin-bottom: 0.6rem;
}

.pub-desc {
  font-size: 0.88rem;
  color: #9ca3af;
  margin-bottom: 0.8rem;
}

.pub-link {
  font-size: 0.85rem;
  color: #22c55e;
  text-decoration: none;
}

.pub-link:hover {
  text-decoration: underline;
}

/* ----- Contact ----- */
.contact-icons-row {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1.3rem;
}

.contact-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px solid #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  text-decoration: none;
  color: #9ca3af;
  background: #020617;
}

.contact-icon:hover {
  border-color: #60a5fa;
  color: #e5e7eb;
}

.footer-text {
  margin-top: 2rem;
  text-align: center;
  color: #6b7280;
  font-size: 0.85rem;
}

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .timeline-line {
    left: 10px;
  }

  .timeline-dot {
    left: 10px;
    transform: translate(0, 4px);
  }

  .timeline-card,
  .timeline-item:nth-child(odd) .timeline-card,
  .timeline-item:nth-child(even) .timeline-card {
    margin: 0 0 0 30px;
    width: calc(100% - 40px);
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
    position: absolute;
    right: 1.25rem;
    top: 3.3rem;
    background: #020617;
    border: 1px solid #1f2937;
    border-radius: 0.75rem;
    padding: 0.6rem 0.9rem;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.9);
  }

  .nav-links.show {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .projects-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-name-gradient {
    font-size: 2.5rem;
  }

  .hero-about-card {
    padding: 1.4rem 1.5rem;
  }

  .pub-row {
    flex-direction: column;
    overflow-x: visible;
  }

  .pub-item {
    max-width: 100%;
  }
}
