@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@300;500;600;800;900&family=Poppins:wght@300;400;500;600&display=swap");

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  text-decoration: none;
  list-style: none;
  scroll-behavior: smooth;
  font-family: "Poppins", sans-serif;
}

/* ----------------- THEME VARIABLES ----------------- */

:root {
  --bg-color: #16191e;
  --second-bg-color: #040401;
  --text-color: #fffdfd;
  --second-color: #ffffff;
  --main-color: #264deace;

  --big-font: 5rem;
  --h2-font: 3rem;
  --p-font: 1.1rem;
}

/* light theme when body has .dark-theme */
.dark-theme {
  --text-color: #0c0c0c;
  --bg-color: #f2f5fa;
  --second-bg-color: #ffffff;
  --second-color: #0f0f0f;
  --main-color: #264deace;
}

body {
  background: var(--bg-color);
  color: var(--text-color);
}

/* ----------------- HEADER & NAV ----------------- */

header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 1000;
}

.navbar {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);

  width: 100%;
  padding: 12px 6%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav {
  color: var(--text-color);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
}

.nav span {
  color: var(--main-color);
}

.navlist {
  display: flex;
  align-items: center;
  gap: 24px;
}

.navlist a {
  color: var(--second-color);
  font-size: 16px;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s ease;
}

.navlist a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--main-color);
  transition: width 0.3s ease;
}

.navlist a:hover,
.navlist a.active {
  color: var(--main-color);
}

.navlist a:hover::after,
.navlist a.active::after {
  width: 100%;
}

.theme-toggle {
  border: none;
  background: transparent;
  color: var(--text-color);
  font-size: 20px;
  cursor: pointer;
  margin-left: 16px;
}

/* Hamburger */
#menu-icon {
  font-size: 32px;
  color: var(--text-color);
  cursor: pointer;
  display: none;
}

/* ----------------- SECTIONS ----------------- */

section {
  padding: 130px 9% 80px;
}

/* ----------------- HOME ----------------- */

.home {
  position: relative;
  min-height: calc(100vh - 80px);
  width: 100%;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  padding: 110px 8% 80px;
}

.homme {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  gap: 2rem;
}

.home-text,
.iimg {
  flex: 1 1 0;
}

.home-text {
  max-width: 560px;
}

.slide {
  margin-bottom: 20px;
}

.one {
  display: inline-block;
  margin-right: 15px;
  padding: 0 15px;
  line-height: 32px;
  font-size: 18px;
  font-weight: 500;
  border-radius: 5px;
  background: var(--main-color);
  color: var(--text-color);
}

.two {
  display: inline-block;
  color: var(--second-color);
  font-size: 18px;
  font-weight: 500;
}

.home-text h1 {
  font-size: var(--big-font);
  margin-bottom: 10px;
}

.home-text h3 {
  font-size: 2.6rem;
  margin-bottom: 15px;
}

.home-text p {
  color: var(--second-color);
  font-size: var(--p-font);
  line-height: 1.7;
  margin-bottom: 30px;
}

span {
  color: var(--main-color);
}

.button .btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--main-color);
  border-radius: 30px;
  color: #ffffff;
  font-weight: 600;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.button .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
}

/* Home image */
.iimg {
  display: flex;
  justify-content: center;
}

.iimg img {
  max-width: 340px;
  width: 100%;
  height: auto;
  border-radius: 50%;
  display: block;
}

/* ----------------- ABOUT ----------------- */

.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  align-items: center;
  gap: 2rem;
}

.about-img img {
  max-width: 400px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.about-text h2 {
  font-size: var(--h2-font);
  line-height: 1.1;
}

.about-text h4 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-color);
  margin: 15px 0 25px;
}

.about-text p {
  color: var(--second-color);
  font-size: var(--p-font);
  line-height: 1.8;
  margin-bottom: 2.5rem;
}

.about-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.about-actions .btn {
  display: inline-block;
  padding: 10px 24px;
  background: var(--main-color);
  color: #fff;
  border-radius: 999px;
  font-weight: 500;
}

/* ----------------- SERVICES / SKILLS ----------------- */

.services {
  background: var(--second-bg-color);
}

.main-text {
  text-align: center;
}

.main-text p {
  color: var(--second-color);
  font-size: 15px;
  margin-bottom: 10px;
}

.main-text h2 {
  font-size: var(--h2-font);
  line-height: 1.1;
}

.services-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2.5rem;
  margin-top: 3.5rem;
}

.box {
  background: var(--bg-color);
  padding: 28px 30px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.box:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.s-icons i {
  font-size: 32px;
  margin-bottom: 16px;
}

.box h3 {
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 10px;
}

.skill-points {
  margin-top: 8px;
  padding-left: 1.2rem;
  color: var(--second-color);
  font-size: 0.98rem;
}

.skill-points li {
  margin-bottom: 0.35rem;
}

/* ----------------- PORTFOLIO ----------------- */

.portfolio {
  background: var(--bg-color);
}

.portfolio-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2.5rem;
  margin-top: 3.5rem;
}

.row {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  cursor: pointer;
  aspect-ratio: 1 / 1;
}

.row img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  transition: transform 0.5s ease;
}

.layer {
  width: 100%;
  height: 0;
  background: linear-gradient(rgba(10, 9, 9, 0.2), rgba(16, 16, 250, 0.9));
  position: absolute;
  left: 0;
  bottom: 0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 24px;
  text-align: center;
  transition: height 0.5s ease;
}

.layer h4 {
  font-size: 20px;
  font-weight: 600;
  margin: 18px 0 10px;
  color: #ffffff;
}

.layer p {
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.6;
}

.layer i {
  color: var(--main-color);
  margin-top: 16px;
  font-size: 22px;
  background: #ffffff;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.row:hover img {
  transform: scale(1.08);
}

.row:hover .layer {
  height: 100%;
}

/* ----------------- CONTACT ----------------- */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: flex-start;
  gap: 3rem;
}

.contact-text h2 {
  font-size: var(--h2-font);
  margin-bottom: 10px;
}

.contact-text h4 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 10px;
}

.contact-text p {
  color: var(--second-color);
  font-size: var(--p-font);
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.contact-icons {
  display: flex;
  gap: 1rem;
}

.contact-icons a i {
  font-size: 28px;
  color: var(--second-color);
  transition: color 0.3s ease, transform 0.3s ease;
}

.contact-icons a:hover i {
  color: var(--main-color);
  transform: translateY(-2px);
}

.contact-form form {
  width: 100%;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 8px;
  border: 2px solid var(--main-color);
  background: var(--bg-color);
  color: var(--text-color);
  font-size: 15px;
  resize: none;
}

.contact-form textarea {
  min-height: 200px;
}

.contact-form .submit {
  display: inline-block;
  width: auto;
  padding: 12px 30px;
  cursor: pointer;
}

/* ----------------- FOOTER ----------------- */

.end {
  padding: 20px 10% 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-color);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.last-text p {
  color: var(--second-color);
  font-size: 14px;
}

.top i {
  padding: 10px;
  border-radius: 8px;
  font-size: 16px;
  color: var(--text-color);
  background: var(--main-color);
}

/* ----------------- RESPONSIVE ----------------- */

/* Large tablets / small laptops */
@media (max-width: 1100px) {
  :root {
    --big-font: 4rem;
    --h2-font: 2.4rem;
    --p-font: 1rem;
  }

  section {
    padding: 130px 7% 70px;
  }

  .home-text h3 {
    font-size: 2.2rem;
  }
}

/* Tablets & small laptops */
@media (max-width: 920px) {
  section {
    padding: 120px 6% 70px;
  }

  .homme {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .home-text {
    text-align: center;
  }

  .home {
    align-items: flex-start;
  }

  .about {
    grid-template-columns: 1fr;
  }

  .about-img {
    order: -1;
    text-align: center;
  }

  .about-img img {
    margin-inline: auto;
  }

  .contact {
    grid-template-columns: 1fr;
    row-gap: 2rem;
  }

  .portfolio-content {
    grid-template-columns: 1fr 1fr;
  }
}

/* Tablets & phones - mobile nav */
@media (max-width: 820px) {
  #menu-icon {
    display: block;
  }

  .navlist {
    position: fixed;
    top: 68px;
    left: 5%;
    width: 90%;
    padding: 16px 20px;
    background: var(--second-bg-color);
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.3s ease;
  }

  .navlist.open {
    max-height: 320px;
    opacity: 1;
    pointer-events: auto;
  }
}

/* Phones */
@media (max-width: 600px) {
  :root {
    --big-font: 2.8rem;
    --h2-font: 2rem;
    --p-font: 0.96rem;
  }

  .navbar {
    padding: 10px 5%;
  }

  section {
    padding: 120px 5% 60px;
  }

  .home {
    padding-top: 130px; /* avoid overlap with fixed navbar */
  }

  .iimg img {
    max-width: 260px;
    margin-inline: auto;
  }

  .portfolio-content {
    grid-template-columns: 1fr;
  }

  .end {
    padding-inline: 5%;
    flex-direction: column;
    text-align: center;
  }
}
