:root {
  --text-color: #1a1c20;
  --link-color: #4a76ee;
  --background-color: #eeeff1;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--text-color);
  background-color: var(--background-color);
  max-width: 1400px;
  margin: 0 auto;
}

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

/* NAVBAR */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 50px;
  height: 80px;
  position: sticky;
  top: 0;
  background-color: var(--background-color);
  z-index: 100;
  border-bottom: 1px solid #d3d3d3;
}

nav .left a {
  color: var(--text-color);
  font-size: 22px;
  font-weight: 600;
}

nav .right {
  display: flex;
  align-items: center;
  gap: 5px;
}

nav .right a {
  color: var(--text-color);
  padding: 8px 12px;
  border-radius: 5px;
  transition: background-color 0.2s ease, color 0.2s ease;
  font-size: 14px;
}

nav .right a:hover {
  background-color: rgba(74, 118, 238, 0.1);
  color: var(--link-color);
}

nav .right a span {
  margin-left: 5px;
}

/* Active nav link indicator */
.nav-link {
  position: relative;
  transition: color 0.3s ease;
}

.nav-link.active-link {
  color: var(--link-color) !important;
}

.nav-link.active-link::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--link-color);
  animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

/* Page transition styles */
.page {
  display: none;
  opacity: 0;
  min-height: calc(100vh - 80px);
  padding: 50px;
}

.page.active {
  display: flex;
  opacity: 1;
  animation: fadeIn 0.4s ease forwards;
}

.page.fade-out {
  display: flex;
  animation: fadeOut 0.3s ease forwards;
}

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

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-15px);
  }
}

/* Page navigation buttons */
.page-nav {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  margin-top: auto;
  padding-top: 40px;
}

.page-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid var(--link-color);
  border-radius: 5px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.page-nav a:hover {
  color: #fff;
  background-color: var(--link-color);
}

.page-nav .prev-page {
  margin-right: auto;
}

/* SECTION 1: Hero */
.hero-section {
  justify-content: space-between;
  align-items: center;
  gap: 40px;
}

.hero-section .text {
  flex: 5;
}

.hero-section .text h2 {
  font-size: 45px;
}

.hero-section .text p {
  margin-top: 10px;
  line-height: 1.6;
}

.hero-section .text .links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

.hero-section .text .links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid var(--link-color);
  border-radius: 5px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.hero-section .text .links a:hover {
  color: #fff;
  background-color: var(--link-color);
  border-color: var(--link-color);
}

.hero-section .headshot {
  display: flex;
  flex: 1;
  justify-content: flex-end;
}

.hero-section .headshot img {
  width: 200px;
  border-radius: 100%;
}

/* SECTION 2: Skills */
.skills-section {
  flex-direction: column;
  align-items: center;
}

.skills-section h2 {
  text-align: center;
  font-size: 35px;
  margin-bottom: 10px;
}

.skills-section .text {
  text-align: center;
  margin-bottom: 20px;
  max-width: 600px;
  line-height: 1.6;
}

.skills-section .cells {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
}

.skills-section .cells .cell {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  width: 200px;
  padding: 10px 20px;
  margin: 10px;
  border: 1.5px solid #d3d3d3;
  border-radius: 5px;
  transition: border-color 0.2s ease;
}

.skills-section .cells .cell:hover {
  border-color: var(--link-color);
}

.skills-section .cells .cell img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 2px;
}

.skills-section .cells .cell span {
  font-size: 18px;
}

/* SECTION 3: Testimony */
.testimony-section {
  flex-direction: column;
}

.testimony-section .header-space {
  height: 1px;
}

.testimony-section h2 {
  font-size: 35px;
  margin-bottom: 30px;
}

.testimony-section .group {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 50px;
}

.testimony-section .group .person-details {
  text-align: center;
  flex: 2;
}

.testimony-section .group .person-details img {
  width: 200px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  border-radius: 50%;
  margin-bottom: 10px;
}

.testimony-section .group .person-details p {
  font-weight: 600;
}

.testimony-section .group .person-details p:last-child {
  font-weight: normal;
}

.testimony-section .group .text {
  flex: 8;
  line-height: 1.6;
  font-style: italic;
}

/* SECTION 4: Contact */
.contact-section {
  flex-direction: column;
}

.contact-section h2 {
  font-size: 35px;
  margin-bottom: 20px;
}

.contact-section .group {
  display: flex;
  gap: 50px;
}

.contact-section .group .text {
  flex: 3;
  margin-top: 20px;
  line-height: 1.6;
}

.contact-section .group form {
  flex: 3;
  display: flex;
  flex-direction: column;
}

.contact-section .group form input,
.contact-section .group form textarea {
  font-family: "Poppins", sans-serif;
  border: 2px solid var(--link-color);
  background-color: transparent;
  padding: 10px;
  margin-bottom: 15px;
  outline: none;
  resize: none;
  border-radius: 5px;
  transition: border-color 0.2s ease;
}

.contact-section .group form input:focus,
.contact-section .group form textarea:focus {
  border-color: var(--text-color);
}

.contact-section .group form button {
  font-size: 16px;
  font-family: "Poppins", sans-serif;
  color: #fff;
  background-color: var(--link-color);
  border: none;
  height: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 5px;
}

.contact-section .group form button:hover {
  filter: brightness(0.9);
  transform: translateY(-1px);
}

/* MEDIA QUERIES */
@media (max-width: 850px) {
  .hero-section .text h2 {
    font-size: 35px;
  }
}

@media (max-width: 740px) {
  .page {
    padding: 30px 20px;
  }

  .hero-section {
    flex-direction: column-reverse;
    text-align: center;
  }

  .hero-section .headshot {
    justify-content: center;
  }

  .hero-section .headshot img {
    width: 250px;
  }

  .hero-section .text .links {
    justify-content: center;
  }

  .testimony-section h2 {
    text-align: center;
  }

  .testimony-section .group {
    flex-direction: column;
  }

  .testimony-section .group .text {
    margin-top: 20px;
  }

  .contact-section .group {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  nav {
    padding: 0 20px;
    flex-wrap: wrap;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  nav .left a {
    font-size: 16px;
  }

  nav .right {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
  }

  /* Page nav links (Home, Skills, Journey, Contact) */
  nav .right .nav-link {
    font-size: 13px;
    padding: 6px 8px;
  }

  nav .right .nav-link span {
    display: inline; /* Keep text visible for page links */
  }

  /* External links (Github, LinkedIn, Email) */
  nav .right a:not(.nav-link) {
    font-size: 20px;
    padding: 8px 10px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  nav .right a:not(.nav-link) span {
    display: none; /* Hide text, show only icons */
  }

  .page {
    padding: 20px 15px;
  }

  .hero-section .text h2 {
    font-size: 30px;
  }

  .hero-section .text .links a {
    padding: 8px 15px;
    font-size: 13px;
    width: 100%;
    justify-content: center;
  }

  .skills-section .cells .cell span {
    font-size: 16px;
  }

  .testimony-section h2 {
    text-align: center;
  }

  .page-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .page-nav a {
    justify-content: center;
    padding: 12px 20px;
  }
}
