/*===============
  Global Styles
===============*/

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  line-height: 1.5;
  /* color: var(--clr-fg); */
  background-color: var(--clr-bg);
  transition: background 0.3s, color 0.3s;
}

.light {
  --clr-bg: #fcfcfc;
  --clr-bg-alt: #fff;
  --clr-fg: #555;
  --clr-fg-alt: #333;
  --clr-primary: #2978b5;
  --shadow: rgba(100, 100, 111, 0.2) 0px 7px 29px 0px;
}

.dark {
  --clr-bg: #23283e;
  --clr-bg-alt: #2a2f4c;
  --clr-fg: #bdbddd;
  --clr-fg-alt: #cdcdff;
  --clr-primary: #90a0d9;
  --shadow: rgba(0, 0, 0, 0.3) 0px 10px 30px;
}

/*==============
  Typography
==============*/

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  color: var(--clr-fg-alt);
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.4rem;
}

a {
  text-decoration: none;
  color: var(--clr-primary);
}

ul {
  list-style: none;
}

/*==============
  Layout
==============*/

.center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.header {
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
  padding: 2em 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

main {
  max-width: 1100px;
  width: 95%;
  margin: 0 auto;
}

.section {
  margin-top: 7em;
}

.section__title {
  text-align: center;
  margin-bottom: 2em;
  text-transform: uppercase;
  color: var(--clr-primary);
  font-weight: 700;
}

/*==============
  Navigation
==============*/

.nav__list {
  display: flex;
  gap: 1.5em;
}

.link {
  position: relative;
  font-weight: 500;
  color: var(--clr-fg);
}

.link:hover::before {
  width: 100%;
}

.link::before {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  height: 2px;
  width: 0%;
  background-color: var(--clr-primary);
  transition: width 0.2s ease-in;
}

/*==============
  Buttons
==============*/

.btn {
  display: inline-block;
  padding: 0.8em 1.4em;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  text-transform: lowercase;
  transition: all 0.3s ease;
}

.btn--outline {
  color: var(--clr-primary);
  border: 2px solid var(--clr-primary);
  background: transparent;
}

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

.btn--icon {
  font-size: 1.2rem;
  background: transparent;
  border: none;
  color: var(--clr-fg);
}

.btn--icon:hover {
  color: var(--clr-primary);
}

/*==============
  About Section
==============*/

.about {
  flex-direction: column;
  text-align: center;
  margin-top: 7em;
  margin-bottom: 15em;
}

.about__name {
  color: var(--clr-primary);
}

.about__role {
  margin-top: 1em;
  font-weight: 500;
}

.about__desc {
  font-size: 1rem;
  max-width: 600px;
  margin-top: 1.5em;
}

.about__contact {
  margin-top: 2em;
  gap: 1em;
}

.link--icon {
  font-size: 1.5rem;
  margin-left: 0.6em;
}

/*==============
  Projects
==============*/

.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18em, 1fr));
  grid-gap: 2em;
}

.project {
  background: var(--clr-bg-alt);
  text-align: center;
  padding: 2em;
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.project:hover {
  transform: translateY(-7px);
}

.project__stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1em;
}

.project__stack li {
  font-size: 0.85rem;
  color: var(--clr-fg-alt);
  margin: 0.3em;
}

/*==============
  Skills
==============*/

.skills__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
}

.skills__list li {
  background: var(--clr-bg-alt);
  box-shadow: var(--shadow);
  margin: 0.5em;
  padding: 0.6em 1em;
  border-radius: 8px;
  font-weight: 500;
  transition: transform 0.2s;
}

.skills__list li:hover {
  transform: translateY(-3px);
}

/*==============
  Hobbies
==============*/

.hobbies__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1em;
}

.hobbies__list li {
  background: var(--clr-bg-alt);
  padding: 0.7em 1.4em;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

/*==============
  Timeline Section (Fixed)
==============*/

.timeline {
  position: relative;
  padding: 1em 0;
  list-style: none;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  background: var(--clr-primary);
  transform: translateX(-50%);
  z-index: 0;
}

.timeline-item {
  position: relative;
  width: 100%;
  margin: 1em 0;
  display: flex;
  justify-content: flex-end;
}

.timeline-item:nth-child(even) {
  justify-content: flex-start;
}


/* ===== Staggered timeline spacing ===== */
.timeline-item {
  margin: 3em 0; /* base spacing for the first item */
}

/* All items after the first start halfway down the previous one */
.timeline-item + .timeline-item {
  margin-top: -4em; /* negative margin creates the overlap */
}

/* Keep consistent dot alignment */
.timeline-dot {
  top: 35px;
}

.timeline-dot {
  position: absolute;
  left: 50%;
  top: 25px;
  width: 18px;
  height: 18px;
  background: var(--clr-primary);
  border: 4px solid var(--clr-bg);
  border-radius: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.timeline-content {
  position: relative;
  background: var(--clr-bg-alt);
  color: var(--clr-fg);
  width: 45%;
  padding: 1.5em 2em;
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 1;
  transition: transform 0.3s ease;
}

.timeline-content:hover {
  transform: translateY(-5px);
}

.timeline-date {
  display: inline-block;
  padding: 5px 1px;
  /* background: var(--clr-primary); */
  /* color: var(--clr-bg); */
  border-radius: 20px;
  font-size: 0.85rem;
  margin-bottom: 1em;
}

.timeline-title {
  /* color: var(--clr-primary); */
  font-size: 1.3rem;
  margin-bottom: 0.4em;
  font-weight: 600;
}

.timeline-company {
  color: var(--clr-fg);
  font-weight: 500;
}

.timeline-location {
  font-size: 0.9rem;
  color: var(--clr-fg-alt);
  margin-bottom: 1em;
}

.timeline-description li {
  margin-bottom: 0.6em;
}

.timeline-image {
  width: 100px;
  height: auto;
  object-fit: contain;
  margin-bottom: 1em;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.timeline-image:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
}

/* dark mode tweak */
.dark .timeline-image {
  filter: brightness(0.9) drop-shadow(0 2px 5px rgba(255,255,255,0.1));
}

/*==============
  Contact
==============*/

.contact {
  flex-direction: column;
  text-align: center;
}

/*==============
  Footer
==============*/

.footer {
  text-align: center;
  padding: 3em 0;
  margin-top: 4em;
  font-size: 0.9rem;
  color: var(--clr-fg);
}

/*==============
  Responsive
==============*/

@media (max-width: 768px) {
  h1 {
    font-size: 2.4rem;
  }

  .timeline::before {
    left: 25px;
    transform: none;
  }

  .timeline-dot {
    left: 25px;
    transform: none;
  }

  .timeline-item {
    justify-content: flex-start;
  }

  .timeline-content {
    width: calc(100% - 60px);
    margin-left: 60px;
  }

  .header {
    flex-direction: column;
    gap: 1em;
  }
}
