@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap");

/*  tempat utama buat nyimpen variabel CSS yang bisa dipakai di mana aja. 
Lebih gampang diubah (cukup ubah sekali, semua ikut berubah) dan bikin kode lebih rapi */
:root {
  --primary-color: #82b7ef;
  --secondary-color: #496c93;
  --extra-light: #f3f4f6;
  --white: #ffffff;
  --gradient-1: linear-gradient(to bottom right, #05366a, #4e82be);
  --gradient-2: linear-gradient(
    to bottom,
    var(--primary-color),
    var(--secondary-color)
  );
  --max-width: 1200px;
}

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

.section__container {
  max-width: var(--max-width);
  margin: auto;
  padding: 5rem 1rem;
}

.section__header {
  margin-bottom: 1rem;
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
}

.section__description {
  max-width: 600px;
  margin-inline: auto;
  color: var(--extra-light);
  text-align: center;
  line-height: 1.75rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--white);
  background-image: var(--gradient-2);
  outline: none;
  border: none;
  border-radius: 5rem;
  cursor: pointer;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
}

img {
  width: 100%;
  display: flex;
}

a {
  text-decoration: none;
}

.logo {
  display: inline-block;
  padding: 10px 14px;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--white);
  background-image: var(--gradient-2);
  border-radius: 100%;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
}

html,
body {
  scroll-behavior: smooth;
}

body {
  font-family: "Montserrat", sans-serif;
  color: var(--white);
  background-image: var(--gradient-1);
}

body,
nav,
section,
footer {
  transition: background 0.4s, color 0.4s;
}

body.dark-mode {
  background: #181818;
  color: #f1f1f1;
}

body.dark-mode footer {
  background: #222;
  color: #f1f1f1;
}

body.dark-mode .btn,
body.dark-mode button,
body.dark-mode .projects__card,
body.dark-mode .skills__card {
  background: #333;
  color: #f1f1f1;
  border-color: #444;
}

body.dark-mode .btn:hover,
body.dark-mode button:hover {
  background: #444;
  color: #ffffff;
}

/* Navbar bar dan menu button di dark mode */
body.dark-mode .nav__menu__btn {
  background: #181818;
  color: #f1f1f1;
  transition: background 0.4s, color 0.4s;
}

/* Navbar links (menu mobile) di dark mode */
body.dark-mode .nav__links.open {
  background: #181818;
  color: #f1f1f1;
  transition: background 0.4s, color 0.4s;
}

/* Navbar link text di dark mode */
body.dark-mode .nav__links a {
  color: #f1f1f1;
}


/* Logo R di nav dan contact */
body.dark-mode .logo,
body.dark-mode .nav__logo {
  background: #ffffff;
  color: #181818;
  transition: background 0.4s, color 0.4s;
}

/* Statistik project banner */
body.dark-mode .projects__banner__card {
 
  color: #ffffff;
  border-color: #444;
  transition: background 0.4s, color 0.4s;
}

/* Teks deskripsi pada project card */
body.dark-mode .projects__card .project-desc p {
  color: #ffffff;
  transition: color 0.4s;
}

body.dark-mode .projects__card {
  background: #444;
  border-color: #444;
}

/* Judul h3 pada project card */
body.dark-mode .projects__card h3 {
  color: #fff3f3;
}

body.dark-mode .projects__banner {
  background: #444;
  transition: background 0.4s;
}

#darkModeToggle {
  position: fixed;
  right: 2rem;
  bottom: 2rem;
  z-index: 999;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  color: #222;
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  cursor: pointer;
  transition: background 0.4s, color 0.4s;
}

/* Dark mode style untuk tombol */
body.dark-mode #darkModeToggle {
  background: #222;
  color: #ffd700;
}

/* Animasi icon */
#darkModeToggle i {
  transition: transform 0.4s;
}
body.dark-mode #darkModeToggle i.ri-sun-line {
  transform: rotate(180deg);
}


nav {
  position: fixed;
  isolation: isolate;
  top: 0;
  width: 100%;
  max-width: var(--max-width);
  margin: auto;
  z-index: 9;
}

.nav__bar {
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  background-image: var(--gradient-1);
}

.nav__logo {
  padding: 9px 12px;
  font-size: 1.2rem;
}

.nav__bar a {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--white);
}

.nav__menu__btn {
  font-size: 1.5rem;
  color: var(--white);
  cursor: pointer;
}

.nav__links {
  list-style: none;
  position: absolute;
  width: 100%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  background-image: var(--gradient-2);
  transform: translateY(-100%);
  transition: 0.5s;
  z-index: -1;
}

.nav__links.open {
  transform: translateY(0);
}

.nav__links a {
  color: var(--white);
  transition: 0.3s;
}

.nav__links a:hover {
  color: var(--white);
}

.btn__large {
  display: none;
}

.header__container {
  padding-top: 8rem;
  display: grid;
  gap: 2rem;
  isolation: isolate;
}

.header__content {
  text-align: center;
}

.header__content h1 {
  margin-bottom: 1rem;
  font-size: 3rem;
  text-align: center;
}

.header__content .section__description {
  margin-bottom: 2rem;
}

.header__image {
  position: relative;
  isolation: isolate;
  z-index: -1;
}

.header__image img {
  max-width: 450px;
  margin-inline: auto;
  border-radius: 20rem;
}

.header__image::after {
  position: absolute;
  content: "RADHEYA";
  letter-spacing: 1.5rem;
  opacity: 0.5;
  right: 1rem;
  top: 50%;
  transform: translate(50%, -50%) rotate(90deg);
}

.about__container {
  display: grid;
  gap: 2rem;
}

.about__image {
  position: relative;
  isolation: isolate;
  max-width: 400px;
  margin: auto;
}

.about__img {
  border-radius: 100%;
}

.about__bg-1{
  position: absolute;
  max-width: 170px;
  z-index: -1;
}
.about__bg-2 {
  position: absolute;
  max-width: 150px;
  z-index: -1;
}

.about__bg-1 {
  top: 0;
  left: 0;
}

.about__bg-2 {
  right: 0;
  bottom: 0;
}

.about__content {
  text-align: center;
}

.about__content .section__description {
  margin-bottom: 2rem;
}

.skills__grid {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}

.skills__card {
  padding: 2rem 1rem;
  text-align: center;
  background-image: var(--gradient-2);
  border-radius: 1rem;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
}

.skills__card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  background: linear-gradient(135deg, #075cb8, #00323c);
  color: #fff;
}

.skills__card span {
  display: inline-block;
  margin-bottom: 1rem;
  font-size: 2rem;
}

.skills__card h4 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  font-weight: 700;
}

.skills__card p {
  color: var(--extra-light);
  line-height: 2rem;
}

/* ...existing code... */

/* Tabs */
.skills__tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}
.skills__tab {
  padding: 0.7rem 2rem;
  border: none;
  background: var(--color-bg2, #f0f0f0);
  color: var(--color-text, #222);
  font-weight: 600;
  cursor: pointer;
  border-radius: 2rem;
  transition: background 0.2s;
}
.skills__tab.active {
  background: var(--color-primary, #4e82be);
  color: #fff;
}

/* Sertifikasi Grid */
.cert__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  /* jangan biarkan kolom mengembang penuh; gunakan max fixed agar baris yang tidak penuh bisa dipusatkan */
  grid-template-columns: repeat(auto-fit, minmax(220px, 280px)); /*hapus ini jika sudah 8 sertif*/
  gap: 1.5rem;
  width: 100%;
  max-width: 1100px; /* batasi lebar keseluruhan grid supaya terlihat terpusat */ /*hapus ini jika sudah 8 sertif*/
  margin: 0 auto;
  padding: 1rem 0;
  justify-content: center; /* pusatkan keseluruhan grid saat ada ruang kosong di baris */ /*hapus ini jika sudah 8 sertifikasi*/
  justify-items: center; /*hapus ini jika sudah 8 sertif*/
}

/* Sertifikat Card */
.cert__card {
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 1rem;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 1rem;
  width: 100%;
  max-width: 320px; /* mencegah card mengembang berlebihan sehingga baris dapat terpusat */ /*hapus ini jika sudah 8 sertif*/
  background: var(--white);
  border-radius: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden;
  transition: background 0.4s, color 0.4s;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  justify-content: center;
}
.cert__card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.cert__img {
  width: 100%;
  max-width: 180px;
  height: auto;
  border-radius: 0.5rem;
  margin-bottom: 0.75rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}
.cert__img:hover {
  transform: scale(1.05);
}
.cert__card h4 {
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  margin: 0.5rem 0 0 0;
  color: #181818;
  font-family: inherit;
}

/* Modal Sertifikat */
.cert__modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.cert__modal__img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 1rem;
  box-shadow: 0 4px 32px rgba(0,0,0,0.3);
}
.cert__close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  font-size: 2.5rem;
  color: #fff;
  cursor: pointer;
  font-weight: bold;
  z-index: 10001;
}

/* Responsive */
@media (max-width: 600px) {
  .cert__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.5rem 0;
  }
  .cert__card {
    padding: 0.5rem;
    font-size: 0.95rem;
  }
  .cert__card h4 {
    font-size: 1rem;
  }
}

/* Dark Mode */
body.dark-mode .skills__tab {
  background: #222;
  color: #eee;
}
body.dark-mode .skills__tab.active {
  background: var(--color-primary, #4e82be);
  color: #fff;
}
body.dark-mode .cert__card {
  background: #222;
  color: #eee;
}
body.dark-mode .cert__card h4 {
  color: #fff;
  transition: color 0.4s;
}
body.dark-mode .cert__modal {
  background: rgba(20,20,20,0.95);
}
body.dark-mode .cert__close {
  color: #fff;
}

.project__quote {
  text-align: center;
  font-style: italic;
  font-size: 1.15rem;
  color: #eee;
  margin: 1rem 0;
  letter-spacing: 1px;
}
body.dark-mode .project__quote {
  color: #ffffff;
}

.projects__grid {
  margin-top: 2rem;
  display: grid;
  gap: 1rem;
}

.projects__card {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  background: #fff;
  margin: 15px;
}

.projects__card:hover {
  transform: scale(1.05) rotate3d(1, 1, 0, 5deg);
}

.project-image {
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: auto;
  transition: transform 0.4s ease;
}

.project-image img:hover {
  transform: scale(1.1); /* efek zoom in */
}

.project-desc {
  padding: 15px;
  text-align: center;
}

.project-desc a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-desc h3 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: #333;
}

.project-desc p {
  font-size: 14px;
  color: #666;
  margin-top: 8px;
}




.projects__card img {
  transition: 0.5s;
}

.projects__card:hover img {
  transform: scale(1.1);
}

.projects__banner {
  margin-top: 2rem;
  padding: 2rem;
  display: grid;
  gap: 2rem;
  text-align: center;
  background-image: var(--gradient-2);
  border-radius: 1rem;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
}

.projects__banner__card span {
  display: inline-block;
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
}

.projects__banner__card h4 {
  font-size: 1.2rem;
  font-weight: 600;
}

.projects__banner__card p {
  font-weight: 500;
}

.contact__container {
  text-align: center;
}

.contact__container .logo {
  margin-bottom: 1rem;
}

.contact__socials {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.contact__socials a {
  padding: 7px 10px;
  font-size: 1.5rem;
  color: var(--white);
  background: rgba(255, 255, 255, 0.2);
  border-radius: 100%;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.1);
  transition: 0.3s;
}

.contact__socials a:hover {
  background: var(--gradient-2);
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
}

.footer {
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--extra-light);
  text-align: center;
}

@media (width > 576px) {
  .skills__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .projects__banner {
    grid-template-columns: repeat(2, 1fr);
    text-align: left;
  }
}

@media (width > 768px) {
  nav {
    padding: 2rem 1rem;
    position: static;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .nav__bar {
    padding: 0;
    background-image: none;
  }

  .nav__menu__btn {
    display: none;
  }

  .nav__links {
    padding: 0;
    width: unset;
    position: static;
    transform: none;
    flex-direction: row;
    background-image: none;
  }

  .nav__links a:hover {
    color: var(--secondary-color);
  }

  .nav__links li:last-child {
    display: none;
  }

  .btn__large {
    display: flex;
  }

  .header__container {
    padding-top: 5rem;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
  }

  .header__image {
    grid-area: 1/3/2/5;
  }

  .header__image img {
    margin-inline-start: unset;
  }

  .header__content {
    grid-area: 1/1/2/4;
    text-align: left;
  }

  .header__content h1 {
    font-size: 6rem;
    line-height: 6rem;
    text-align: left;
  }

  .header__content .section__description {
    text-align: left;
    margin-inline-start: unset;
  }

  .about__container {
    grid-template-columns: repeat(2, 1fr);
    align-items: center;
  }

  .about__content,
  .about__content :is(.section__header, .section__description) {
    text-align: left;
  }

  .skills__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .projects__container :is(.section__header, .section__description) {
    text-align: left;
    margin-inline-start: unset;
  }

  .projects__grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .projects__banner {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 576px) {
  .projects__container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  .projects__grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .projects__card {
    margin-left: 0;
    margin-right: 0;
  }
}