/* Project styling: variables, navbar, sections, cards, footer */

@import url("https://fonts.googleapis.com/css2?family=Lexend:wght@100..900&display=swap");

/* ==========================
   Variables
========================== */
:root {
  --primary-color: #297afc;
  --secondary-color: #3B82F6;
  --bg-primary: #ffffff;
  --text-color: #000000;
  --text-color-two: #ffffff;
  --bg-secondary: #000000;
  --card-background: #f4f4f4;
  --bg-secondary-two: #000000;
  --card-border: rgba(41, 122, 252, 0.08);
  --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.06); /* softened so it fades out before the edge */
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.2);

  --btn-bg: #007bff;
  --btn-color: #000000;
  --btn-hover-color: #ffffff;
  --btn-glow: rgb(0, 123, 255);
  --btn-glow-hover: rgba(0, 123, 255, 1);

  --weight-small: 400;
  --weight-semibold: 600;
  --weight-bold: 800;

  --width-small: 600px;
  --width-medium: 1100px;
  --width-large: 1300px;
}

[data-theme="dark"] {
  --bg-primary: #000000;
  --text-color: #ffffff;
  --text-color-two: #222222;
  --bg-secondary: #ffffff;
  --card-background: #181818;
  --bg-secondary-two: #f4f4f4;
  --card-border: rgba(255, 255, 255, 0.08);
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow: 0 2px 10px rgba(95, 95, 95, 0.2);

  --btn-glow: rgba(255, 255, 255, 0.25);
}

/* ==========================
   Base
========================== */
html {
  font-size: 100%;
  scroll-behavior: smooth;
}

.bold-section p {
  font-weight: 700;
}

.highlight {
  font-weight: bold;
}

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

ul { list-style: none; }

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

body {
  background: var(--bg-primary);
  color: var(--text-color);
  font-family: "Lexend", sans-serif;
  line-height: 1.5;

  /* Disable copy */
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

/* Keep anchored sections clear of the fixed navbar */
section, #contact { scroll-margin-top: 90px; }

.division {
  width: 100%;
  height: 2px;
  background-color: var(--card-background);
  margin: 5.5rem 0;
}

/* ==========================
   Navbar
========================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--bg-primary);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
  width: 100%;
}

.navbar .nav-menu {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
}

.navbar .nav-link {
  margin: 0 1rem;
  font-size: 0.8rem;
  font-weight: var(--weight-semibold);
}

.navbar #logo img {
  display: block;
  width: 40px;
  transition: all 0.35s ease;
  filter: drop-shadow(0 0 0 rgba(41, 122, 252, 0));
}

.navbar .btn { margin-right: 1.5rem; }

/* Buttons glow */
.btn {
  position: relative;
  /* removed overflow-x: auto (it forced overflow-y: auto and could clip the glow) */
  transition: all 0.35s ease;
  border: 1px solid rgba(41, 122, 252, 0.3);
}

.btn:hover {
  color: #fff;
  background: #297afc;
}

/* Hamburger */
.hamburger {
  margin-bottom: 0.1rem;
  display: none;
}

.bar {
  display: block;
  width: 23px;
  height: 3px;
  margin: 4px auto;
  transition: all 0.3s ease-in-out;
  border-radius: 30px;
  background-color: var(--bg-secondary);
}

/* ==========================
   Documents dropdown (+)
========================== */
.doc-dropdown {
  position: relative;
  margin-right: 1.5rem;
}

.navbar .doc-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-color);
  font-size: 0.9rem;
  cursor: pointer;
}

.doc-toggle i { transition: transform 0.3s ease; }

.doc-dropdown.open .doc-toggle {
  background: #297afc;
  border-color: #297afc;
  color: #fff;
}

.doc-dropdown.open .doc-toggle i { transform: rotate(45deg); }

.doc-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 190px;
  padding: 8px;
  background: var(--card-background);
  border: 1px solid rgba(41, 122, 252, 0.15);
  border-radius: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.3s ease;
  z-index: 30;
}

.doc-dropdown.open .doc-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.doc-menu li a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: var(--weight-semibold);
  transition: all 0.25s ease;
}

.doc-menu li a i {
  width: 18px;
  text-align: center;
  color: #297afc;
  transition: color 0.25s ease;
}

.doc-menu li a:hover { background: #297afc; color: #fff; }
.doc-menu li a:hover i { color: #fff; }

/* ==========================
   Hero
========================== */
#hero {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.profile-image {
  width: 150px;
  border-radius: 50%;
  animation: bounce 1s infinite alternate;
}

@keyframes bounce {
  from { transform: translateY(0); }
  to   { transform: translateY(-10px); }
}

/* ==========================
   Shared card styles
========================== */
.skill-card,
.experience-card,
.project-card {
  position: relative;
  overflow: hidden; /* was overflow-x: auto; keeps image zoom inside rounded corners */
  background: var(--card-background);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  transition: transform 0.45s ease, box-shadow 0.45s ease, border-color 0.45s ease;
  opacity: 0;
  animation: cardFade 0.8s forwards;
}

/* Animated top border */
.skill-card::before,
.experience-card::before,
.project-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 4px;
  background: #297afc;
  transition: 0.55s ease;
}

/* Blue glow */
.skill-card::after,
.experience-card::after,
.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(41, 122, 252, 0.12), transparent 70%);
  opacity: 0;
  pointer-events: none;
  transition: 0.45s ease;
}

.skill-card:hover,
.experience-card:hover,
.project-card:hover {
  transform: translateY(-12px) scale(1.02);
  border-color: rgba(41, 122, 252, 0.35);
  box-shadow: 0 20px 50px rgba(41, 122, 252, 0.18);
}

.skill-card:hover::before,
.experience-card:hover::before,
.project-card:hover::before { width: 100%; }

.skill-card:hover::after,
.experience-card:hover::after,
.project-card:hover::after { opacity: 1; }

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

/* ==========================
   Skills
========================== */
.skills-container {
  padding: 100px 0;
  position: relative;
  background: var(--bg-primary);
}

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

.skill-card {
  padding: 35px 25px;
  text-align: center;
}

.skill-card:hover { transform: translateY(-12px) scale(1.04); }

.skill-card i {
  font-size: 52px;
  color: #297afc;
  margin-bottom: 20px;
}

.skill-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  transition: 0.35s;
}

.skill-card:hover h3 { color: #297afc; }

/* Staggered reveal (capped so later cards don't wait too long) */
.skill-card:nth-child(1)  { animation-delay: 0.05s; }
.skill-card:nth-child(2)  { animation-delay: 0.10s; }
.skill-card:nth-child(3)  { animation-delay: 0.15s; }
.skill-card:nth-child(4)  { animation-delay: 0.20s; }
.skill-card:nth-child(5)  { animation-delay: 0.25s; }
.skill-card:nth-child(6)  { animation-delay: 0.30s; }
.skill-card:nth-child(7)  { animation-delay: 0.35s; }
.skill-card:nth-child(8)  { animation-delay: 0.40s; }
.skill-card:nth-child(n+9) { animation-delay: 0.45s; }

/* ==========================
   Work experience
========================== */
.experience-container {
  padding: 100px 0;
  position: relative;
  background: var(--bg-primary);
}

.experience-container .division { margin-bottom: 30px; }

.experience-card {
  margin: 35px 0;
  padding: 30px;
}

.experience-card:nth-of-type(1) { animation-delay: 0.2s; }
.experience-card:nth-of-type(2) { animation-delay: 0.4s; }

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 25px;
}

.experience-header h3 {
  font-size: 1.4rem;
  margin-bottom: 6px;
  transition: 0.35s;
}

.experience-header h4 {
  color: var(--text-color);
  opacity: 0.75;
  font-weight: 500;
  transition: 0.35s;
}

.experience-card:hover h3,
.experience-card:hover h4 { color: #297afc; }

.experience-header span {
  padding: 8px 16px;
  border-radius: 30px;
  background: rgba(41, 122, 252, 0.08);
  color: #297afc;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  transition: 0.35s;
}

.experience-header span:hover {
  background: #297afc;
  color: #fff;
  transform: translateY(-2px);
}

.experience-card li {
  position: relative;
  padding-left: 28px;
  margin: 14px 0;
  line-height: 1.8;
}

.experience-card li::before {
  content: "➜";
  position: absolute;
  left: 0;
  top: 0;
  color: #297afc;
  font-size: 16px;
  font-weight: bold;
  transition: transform 0.35s;
}

.experience-card li:hover::before { transform: translateX(4px); }

/* ==========================
   Projects
========================== */
.projects-container {
  padding: 100px 0;
  position: relative;
  background: var(--bg-primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  align-items: stretch;
  gap: 35px;
}

/* Give card shadows + hover lift room inside the grids so they never get clipped.
   Padding adds the space, negative margin cancels it so layout doesn't shift. */
.skills-grid,
.projects-grid {
  padding: 20px 0 70px;
  margin: 30px 0 -20px;
}

.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.4s; }
.project-card:nth-child(n+4) { animation-delay: 0.6s; }

.project-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.55s ease, filter 0.45s ease;
}

.project-card:hover img {
  transform: scale(1.08);
  filter: brightness(1.05);
}

/* Equal-height cards, buttons pinned to the bottom */
.project-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 25px;
}

.project-content h3 {
  font-size: 1.4rem;
  margin-bottom: 15px;
  transition: 0.35s;
}

.project-card:hover h3 { color: #297afc; }

.project-content p {
  color: var(--text-color);
  opacity: 0.8;
  line-height: 1.8;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 25px 0;
}

.project-tech span {
  padding: 8px 16px;
  border-radius: 30px;
  background: rgba(41, 122, 252, 0.08);
  color: #297afc;
  font-size: 0.85rem;
  font-weight: 600;
  transition: 0.35s;
}

.project-tech span:hover {
  background: #297afc;
  color: #fff;
  transform: translateY(-2px);
}

.project-buttons {
  display: flex;
  gap: 15px;
  margin-top: auto;
  padding-top: 20px;
}

.project-buttons .btn {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  transition: 0.35s ease;
}

.project-buttons .btn:hover { transform: translateY(-3px); }

/* ==========================
   Scroll-to-top button
========================== */
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 55px;
  height: 55px;
  background: var(--btn-bg);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px var(--btn-glow);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 25;
}

.scroll-top i {
  color: var(--btn-color);
  font-size: 20px;
  transition: color 0.4s ease;
}

.scroll-top:hover {
  box-shadow: 0 0 20px var(--btn-glow-hover);
  transform: scale(1.1);
}

.scroll-top:hover i { color: var(--btn-hover-color); }

.scroll-top.show {
  opacity: 1;
  visibility: visible;
}

/* ==========================
   Footer
========================== */
#footer { transition: background 0.4s ease, color 0.4s ease; }

#footer .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: 2rem 0;
  text-align: center;
}

#footer a {
  font-size: 0.8rem;
  transition: 0.3s ease;
}

#footer a:hover { color: #297afc; }

#footer .social {
  display: flex;
  gap: 18px;
  margin: 1rem 0;
}

#footer .social a {
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(41, 122, 252, 0.15);
  transition: transform 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

#footer .social a:hover {
  color: #297afc;
  border-color: #297afc;
  box-shadow: 0 8px 20px rgba(41, 122, 252, 0.2);
  transform: translateY(-4px);
}

#footer .social i { font-size: 20px; }

#footer p { font-size: 0.8rem; }

/* ==========================
   Responsive
========================== */
@media (max-width: 768px) {
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
  }

  .skill-card { padding: 28px 20px; }
  .skill-card i { font-size: 42px; }
  .skill-card h3 { font-size: 0.95rem; }

  .experience-card { margin: 25px 0; padding: 25px; }

  .experience-header {
    flex-direction: column;
    gap: 15px;
  }

  .experience-header span { width: max-content; }
}

@media (max-width: 670px) {
  .navbar .nav-menu {
    position: fixed;
    right: -100vw;
    top: 4.5rem;
    flex-direction: column;
    width: calc(80% - 10px);
    transition: 0.3s;
    box-shadow: var(--shadow);
    padding: 2rem;
    border-radius: 5px;
    align-items: flex-start;
  }

  .nav-menu.active { right: 20px; }

  .nav-menu .nav-link {
    font-size: 0.9rem;
    margin: 0 0.2rem;
  }

  .nav-menu li {
    margin-bottom: 0.5rem;
    width: 100%;
  }

  .navbar .btn {
    margin: 0;
    margin-top: 0.5rem;
  }

  /* Dropdown opens inline inside the mobile panel */
  .doc-dropdown { margin-right: 0; }

  .navbar .doc-toggle {
    width: 100%;
    height: 42px;
    border-radius: 5px;
  }

  .doc-menu {
    position: static;
    display: none;
    margin-top: 0.5rem;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
  }

  .doc-dropdown.open .doc-menu { display: block; }

  .hamburger {
    display: block;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
  }

  .hamburger.active { border: 1px dotted gray; }
  .hamburger.active .bar:nth-child(2) { opacity: 0; }
  .hamburger.active .bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

@media (max-width: 600px) {
  .header-container .btn {
    border-radius: 5px;
    width: 80%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
  }
}
