/* --- BASE STYLES --- */
*, *::before, *::after {
box-sizing: border-box;
}

body {
  background-color: #121212;
  color: #eaeaea;
  font-family: 'Inter', sans-serif;
  line-height: 1.6;
  margin: 0;
  padding: 0 1rem;
}

header {
  text-align: center;
}

header, section {
  max-width: 800px;
  margin: 2rem auto;
}


.nav-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-brand-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-brand {
  font-weight: bold;
  font-size: 1.1rem;
  color: #ffffff;
  letter-spacing: 0.01em;
}

.nav-profile-pic {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #fff;
}

@media (max-width: 700px) {
  .nav-profile-pic {
    width: 28px;
    height: 28px;
  }
}

  nav#navbar {
    width: 100%;
  }
  .nav-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
    gap: 1rem;
  }
  .nav-brand-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }
  .nav-brand {
    font-weight: bold;
    font-size: 1.1rem;
    color: #ffffff;
    letter-spacing: 0.01em;
    display: inline-block;
  }
  .menu-toggle {
    margin-left: auto;
  }
  @media (max-width: 700px) {
    .nav-container {
      flex-wrap: nowrap;
      gap: 0.5rem;
      padding: 0.5rem 0.5rem 0.5rem 0.5rem;
    }
    .nav-brand-group {
      gap: 0.5rem;
    }
    .nav-profile-pic {
      width: 28px !important;
      height: 28px !important;
      min-width: 28px !important;
      min-height: 28px !important;
      max-width: 28px !important;
      max-height: 28px !important;
    }
    .nav-brand {
      font-size: 1rem;
    }
    .menu-toggle {
      margin-left: auto;
      display: block;
      /* width: 120px;
      height: 120px; */
      object-fit: cover;
      border-radius: 50%;
      border: 2px solid #ffffff;
      background: #222;
      box-shadow: 0 2px 12px rgba(0,0,0,0.18);
  }
  .nav-profile-pic {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    max-width: 28px;
    max-height: 28px;
  }
  .nav-brand {
    font-size: 1rem;
  }
  .menu-toggle {
    margin-left: auto;
  }
}

a:focus {
  outline: none;
}

a:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

ul {
  padding-left: 1.2rem;
}

.button {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.6rem 1.2rem;
  background-color: #ffffff;
  color: #121212;
  border-radius: 25px;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.2s ease;
  min-width: 140px;
  text-align: center;
}

.button:hover {
  background-color: #bbbbbb;
  text-decoration: none;
  transform: translateY(-2px);
}

.button:focus-visible,
.icon-button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px #121212, 0 0 0 5px #ffffff;
}

.cv-bridge {
  width: 100%;
  max-width: 800px;
  margin: 0.25rem auto 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.cv-bridge p {
  margin: 0 0 0.35rem;
  color: #ffffff;
  font-size: 0.98rem;
  text-align: center;
}

.cv-bridge .button {
  margin-top: 0.35rem;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  margin: 0.5rem;
  transition: background-color 0.3s ease;
  text-decoration: none;
}

.icon-button:hover {
  background-color: #bbbbbb;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.profile-pic {
  width: 150px;
  height: 150px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #ffffff;
  display: block;
  margin: 2rem auto 1rem auto;
}

/* --- NAVIGATION --- */

nav {
  position: sticky;
  top: 0;
  background-color: #121212;
  z-index: 100;
  border-bottom: 1px solid #333;
}

.nav-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem;
  flex-wrap: wrap;
}

.nav-brand {
  font-weight: bold;
  font-size: 1.1rem;
  color: #ffffff;
}

.nav-links {
  display: flex;
  padding: 0.8rem 0;
}

.nav-links a {
  margin: 0 0.6rem;
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
}

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

.nav-links a.active {
  border-bottom: 2px solid #ffffff;
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  background: none;
  color: #ffffff;
  border: none;
  cursor: pointer;
}

@media (max-width: 700px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: center;
    background-color: #121212;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    border-top: 1px solid #333;
  }

  .nav-links a {
    padding: 0.75rem;
    border-bottom: 1px solid #2c2c2c;
    width: 100%;
    text-align: center;
  }

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

section {
  padding-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

section:nth-of-type(2) { animation-delay: 0.1s; }
section:nth-of-type(3) { animation-delay: 0.2s; }
section:nth-of-type(4) { animation-delay: 0.3s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.section-offset {
  scroll-margin-top: 90px;
}

/* --- EXPERIENCE --- */

.timeline-wrapper {
  position: relative;
  margin: 3rem auto;
  max-width: 800px;
  padding: 2rem 0;
  isolation: isolate; /* ensure stacking context */
}

.timeline-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 4px;
  background-color: #ffffff;
  transform: translateX(-50%);
  z-index: 1;
}

.timeline-item {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 2rem 0;
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline-item.left .timeline-content {
  width: 40%;
  padding: 1rem;
  background-color: #ffffff;
  border-radius: 6px;
  box-shadow: none;
  color: #ffffff;
  transition: all 0.3s ease;

}

.timeline-item.left .timeline-description {
  width: 40%;
  padding: 1rem;
  background-color: transparent;
  border-radius: 6px;
  box-shadow: none;
  color: #ffffff;
  transition: all 0.3s ease;
}

.timeline-item.right .timeline-content {
  width: 40%;
  padding: 1rem;
  background-color: #ffffff;
  border-radius: 6px;
  box-shadow: none;
  color: #ffffff;
  transition: all 0.3s ease;
}

.timeline-item.right .timeline-description {
  width: 40%;
  padding: 1rem;
  background-color: transparent;
  border-radius: 6px;
  box-shadow: none;
  color: #ffffff;
  transition: all 0.3s ease;
}

.timeline-item.left .timeline-content {
  margin-right: auto;
  text-align: left;
  order: 1;
  z-index: 2;
  color: #ffffff;
}

.timeline-item.right .timeline-content {
  margin-left: auto;
  text-align: left;
  order: 2;
  z-index: 2;
  color: #ffffff;
}

.timeline-item.left .timeline-description {
  margin-left: auto;
  text-align: left;
  order: 2;
  z-index: 2;
  color: #ffffff;
}

.timeline-item.right .timeline-description {
  margin-right: auto;
  text-align: left;
  order: 1;
  z-index: 2;
  color: #ffffff;
}

.timeline-description:empty {
  display: none;
}

.timeline-block {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timeline-dot {
  width: 24px;
  height: 24px;
  background-color: #121212;
  border: 6px solid #ffffff;
  border-radius: 50%;
  position: relative; /* CHANGED from absolute to relative */
  overflow: visible;
  z-index: 10;
  margin: 0 auto;
  opacity: 1;
  box-sizing: border-box;
  transition: background-color 0.3s ease;
}

.timeline-dot .timeline-dot-date {
  position: absolute;
  left: calc(100% + 18px);  /* CHANGED: was +10px */
  top: 50%;
  transform: translateY(-50%);
  color: #ffffff;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  z-index: 20;
  pointer-events: none;
}

.timeline-dot.active {
  background-color: #ffffff;
}

@media (max-width: 768px) {
  .timeline-line {
    left: 18px; /* CHANGED: aligns to dot centre (dot outer size is ~36px, half is 18px) */
  }

  .timeline-block {
    align-items: flex-start; /* ADDED: stop centering the dot */
  }

  .timeline-dot {
    margin: 0;           /* CHANGED: remove centering */
    position: relative;  /* keep as-is */
    left: 5px;             /* ensure no leftover offsets */
    transform: none;     /* CHANGED: remove translate */
  }

  .timeline-item {
    flex-direction: column;
    align-items: flex-start;
    padding-left: 3.25rem; /* gives space for line+dot */
  }

  .timeline-item.left .timeline-content,
  .timeline-item.right .timeline-content,
  .timeline-item.left .timeline-description,
  .timeline-item.right .timeline-description {
    width: auto;
    max-width: calc(100% - 3.25rem);
    text-align: left;
    margin: 0;
    order: unset;
  }
}
.role-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.role-header img {
  width: 70px;
  height: 70px;
  object-fit: contain;
  border-radius: 4px;
  margin-top: 0;
}

.role-info h4 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: bold;
  color: #121212;
}

.company-link {
  color: #333;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
}

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

.company-dates {
  font-size: 0.85rem;
  color: #666;
}

/* --- PROJECTS TABLE --- */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  padding: 0.85rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, border-color 180ms ease;
}

.tab:hover,
.tab.active {
  background-color: #ffffff;
  color: #121212;
  border-color: #ffffff;
  transform: translateY(-1px);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease forwards;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tab-content details {
  margin-bottom: 1rem;
  background: #ffffff;
  padding: 1rem;
  border-radius: 6px;
  color: #121212;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.2s ease;
}

.tab-content details[open] {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* --- PROJECTS (mobile accordion) --- */
.projects-accordion {
  display: none; /* desktop hidden by default */
  margin-top: 1rem;
}

.proj-acc {
  margin: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.proj-acc > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 0;
  color: #ffffff;
  font-weight: 600;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 180ms ease;
}

.proj-acc > summary:hover {
  color: #d8d8d8;
}

/* remove default marker */
.proj-acc > summary::-webkit-details-marker { display: none; }

/* custom chevron */
.proj-acc > summary::after {
  content: "▾";
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0.9;
}

.proj-acc[open] > summary {
  color: #ffffff;
}

.proj-acc[open] > summary::after {
  content: "▴";
}

.proj-acc-body {
  padding: 0 0 4px;
  background: transparent;
}

/* Make inner project <details> match your existing white cards */
.proj-acc-body details {
  margin-bottom: 12px;
  background: #ffffff;
  padding: 10px;
  border-radius: 10px;
  color: #121212;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  /* margin-left: 12px; */
}

.proj-acc-body details summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  /* gap: 0.5rem; */
  padding: 0;
  /* margin: -1rem -1rem 0.6rem -1rem; */
  padding: 0.55rem 1rem;
  /* min-height: 48px; */
  color: #121212;
  width: 100%;
}

.proj-acc-body details summary::-webkit-details-marker {
  display: none !important;
}

.proj-acc-body details summary::-moz-list-bullet {
  display: none !important;
}

.proj-acc-body details summary {
  margin-left: 0.5rem;
  padding-left: 0rem;
}

.proj-acc-body details p {
  color: #121212;
  margin-top: 0;
  margin-bottom: 0;
}

.proj-acc-body details summary::before {
  content: "";
  display: block;
}

.proj-acc-body details summary::after {
  content: "▾";
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 0.75rem;
}

.proj-acc-body details summary > *:first-child {
  flex: 1 1 auto;
  min-width: 0;
}

.proj-acc-body details[open] summary::after {
  content: "▴";
}

.proj-acc:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.18);
}

/* --- Switch UI on mobile --- */
@media (max-width: 700px) {
  .tabs { display: none; }
  .tab-content { display: none !important; }
  .projects-accordion { display: block; }
}

/* --- EDUCATION CARDS --- */

.edu-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.edu-card {
  display: flex;
  align-items: center;
  background-color: #ffffff;
  color: #121212;
  padding: 1rem;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: box-shadow 0.2s ease;
}

.edu-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.edu-card img {
  width: 100px;
  height: auto;
  margin-right: 1rem;
}

.edu-text h4 {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
}

.edu-text p {
  margin: 0;
  font-size: 0.95rem;
  color: #444;
}

@media (max-width: 600px) {
  .edu-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .edu-card img {
    margin-bottom: 0.5rem;
  }
}

/* --- CERTIFICATIONS --- */

.certs {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
  align-items: flex-start; /* important for tooltip below */
  margin-top: 16px;
}

.cert {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 124px;             /* unified size */
  height: 124px;
  padding: 10px;            /* gives breathing room */
  border-radius: 14px;
  text-decoration: none;
  outline: none;
  background: transparent;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.cert img {
  width: 100%;
  height: 100%;
  object-fit: contain;      /* ensures same visual size */
  border-radius: 10px;
  display: block;
}

.cert:hover,
.cert:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

.tooltip {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%, 0);
  text-align: center;
  width: max-content;
  max-width: 220px;
  background: transparent;
  color: #fff;
  padding: 12px 12px 10px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.25;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 10;
  transition: opacity 140ms ease, transform 140ms ease;
}

.tooltip strong {
  display: block;
  margin-bottom: 6px;
  font-size: 0.98rem;
}

.tooltip span {
  display: block;
  opacity: 0.92;
}

.tooltip em {
  display: block;
  margin-top: 8px;
  opacity: 0.75;
  font-style: normal;
  font-size: 0.85rem;
}

.cert:hover .tooltip,
.cert:focus-visible .tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(4px);
}

/* small arrow */
.tooltip::after {
  content: "";
  position: absolute;
  bottom: 100%;            /* arrow on top of tooltip */
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-bottom-color: rgba(20, 20, 20, 0.96);
}

.badge {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge img {
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

@media (max-width: 700px) {
  .cert {
    width: 112px;
    height: 112px;
  }
}

/* --- CORE SKILLS -- */

.skills-3col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.skill-item {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
  font: inherit;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease, border-color 180ms ease;
  min-height: 72px;
  display: flex;
  align-items: center;
}

.skill-item:hover,
.skill-item:focus-visible,
.skill-item.is-active {
  background: #ffffff;
  color: #121212;
  border-color: #ffffff;
  transform: translateY(-1px);
  outline: none;
}

.skill-proof {
  display: none;
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 18px;
  border-radius: 12px;
  background: #ffffff;
  color: #121212;
  width: 100%;
  box-sizing: border-box;
}

/* Responsive: collapse to 1 column on small screens */
@media (max-width: 700px) {
  .skills-3col {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}
