@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: 'Poppins', sans-serif;
}

html{
    font-size: 62.5%;
}

body{
    width: 100%;
    height: 100vh;
    overflow-x: hidden;
    background-color: black;
    color: white;
}

/* HEADER */
header{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem 9%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.logo{
    font-size: 3rem;
    color: #b74b4b;
    font-weight: 800;
    cursor: pointer;
    transition: 0.5s ease;
}

.logo:hover{
    transform: scale(1.1);
}

nav a{
    font-size: 1.8rem;
    color: white;
    margin-left: 4rem;
    font-weight: 500;
    transition: 0.3s ease;
    border-bottom: 3px solid transparent;
}

nav a:hover,
nav a.active{
    color: #b74b4b;
    border-bottom: 3px solid #b74b4b;
}

/* HOME */
section{
    min-height: 100vh;
    padding: 12rem 9% 5rem; 
}

.home{
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8rem;
    position: relative;
  overflow: hidden;
}

.home .home-content h1{
    font-size: 6rem;
    font-weight: 700;
    line-height: 1.3;
}

span{
    color: #b74b4b;
}

.home-content h3{
    font-size: 4rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.home-content p{
    font-size: 1.6rem;
}

.home-img{
    border-radius: 50%;
}

.home-img img{
    width: 32vw;
    border-radius: 50%;
    box-shadow: 0 0 25px #b74b4b;
    transition: 0.3s ease;
}

.home-img img:hover{
    transform: scale(1.05);
}

/* SOCIAL ICONS */
.social-icons a{
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 4rem;
    height: 4rem;
    background-color: transparent;
    border: 0.2rem solid #b74b4b;
    font-size: 2rem;
    border-radius: 50%;
    margin: 3rem 1.5rem 3rem 0;
    transition: 0.3s ease;
    color: #b74b4b;
}

.social-icons a:hover{
    color: black;
    transform: scale(1.3) translateY(-5px);
    background-color: #b74b4b;
    box-shadow: 0 0 25px #b74b4b;
}

/* BUTTON */
.btn{
    display: inline-block;
    padding: 1rem 2.8rem;
    background-color: black;
    border-radius: 4rem;
    font-size: 1.6rem;
    color: #b74b4b;
    letter-spacing: 0.3rem;
    font-weight: 600;
    border: 2px solid #b74b4b;
    transition: 0.3s ease;
}

.btn:hover{
    transform: scale(1.03);
    background-color: #b74b4b;
    color: black;
    box-shadow: 0 0 25px #b74b4b;
}

/* TYPING ANIMATION */
.typing-text{
    font-size: 34px;
    font-weight: 600;
    min-width: 280px;
}

.typing-text span{
    position: relative;
}

.typing-text span::before{
    content: "Web Developer";
    color: #b74b4b;
    animation: words 20s infinite;
}

.typing-text span::after{
    content: "";
    background-color: black;
    position: absolute;
    width: calc(100% + 8px);
    height: 100%;
    border-left: 3px solid #b74b4b;
    right: -8px;
    animation: cursor 0.6s infinite;
}

@keyframes cursor{
    to{
        border-left: 3px solid transparent;
    }
}

@keyframes words{
    0%, 20%{
        content: "Web Developer";
    }
    21%, 40%{
        content: "Programmer";
    }
    41%, 60%{
        content: "Web Designer";
    }
    61%, 80%{
        content: "Youtuber";
    }
    81%, 100%{
        content: "Script Writer";
    }
}

/* RESPONSIVE */
@media (max-width: 1000px){
    .home{
        gap: 4rem;
    }
}

@media(max-width:995px){
    .home{
        flex-direction: column;
        margin: 5rem 4rem;
        text-align: center;
    }

    .home-content h3{
        font-size: 2.5rem;
    }

    .home-content h1{
        font-size: 5rem;
    }

    .home-img img{
        width: 70vw;
        margin-top: 4rem;
    }
}

#bg-animation {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 500px;
  transform: translate(-50%, -50%);
  z-index: -1;
  opacity: 0.7;
}

/* Scroll Fade Animation */
.home-content,
.home-img img {
  opacity: 0;
  transform: translateY(30px);
  transition: 1s ease;
}

.home-content.show,
.home-img img.show {
  opacity: 1;
  transform: translateY(0);
}

/* 🔹 Latar belakang bintang bergerak ala Star Wars */
#bg-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -5; /* supaya di belakang konten */
    background: black;
}

.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: fly 4s linear infinite;
    opacity: 0.8;
}

@keyframes fly {
    0% {
        transform: translateZ(0) scale(0.5);
        opacity: 0.3;
    }
    100% {
        transform: translateZ(300px) scale(4);
        opacity: 1;
    }
}

/* ✨ Gradient ala galaksi */
body {
    background: radial-gradient(circle, #050505 0%, #000 100%);
    overflow-x: hidden;
}

/* ⭐ Hyper Space Star Animation */
#bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1; /* Tetap di belakang foto & teks */
  overflow: hidden;
}

.star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: white;
  border-radius: 50%;
  opacity: 0.8;
  animation: moveStar 2.5s linear infinite;
}

@keyframes moveStar {
  0% {
    transform: translateZ(0) scale(1);
    opacity: 0.3;
  }
  100% {
    transform: translateY(100vh) scale(2);
    opacity: 1;
  }
}

/* ⭐ Warp Speed Hyperspace */
#stars-warp {
  position: fixed;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  top: 0; left: 0;
  z-index: -3;
}

.warp-star {
  position: absolute;
  width: 2px; height: 2px;
  background: white;
  border-radius: 50%;
  animation: warp 1.5s linear infinite;
}

@keyframes warp {
  to {
    transform: translateY(120vh) scale(2);
    opacity: 0;
  }
}

/* 🌌 Galaxy Parallax Layer */
#galaxy {
  position: fixed;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, #ffffff 1px, transparent 1px),
              radial-gradient(circle, #ffffff 1px, transparent 1px);
  background-size: 3px 3px;
  animation: galaxyMove 60s linear infinite;
  z-index: -4;
  opacity: 0.3;
}

@keyframes galaxyMove {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(360deg) scale(1.3); }
}

/* 🎬 Star Wars Intro */
#sw-intro {
  position: fixed;
  width: 100%;
  bottom: -100%;
  text-align: center;
  transform: perspective(500px) rotateX(20deg);
  animation: scroll 25s linear infinite;
  font-weight: 600;
  z-index: -2;
}

#sw-intro .title {
  font-size: 4rem;
  color: yellow;
}

#sw-intro .scroll-text {
  font-size: 2rem;
  width: 60%;
  margin: auto;
}

@keyframes scroll {
  0% { bottom: -30%; opacity: 1; }
  100% { bottom: 110%; opacity: 0; }
}

/* ⭐ Certificate Section */
.certificate {
    text-align: center;
}

.certificate .heading {
    font-size: 5rem;
    margin-bottom: 4rem;
    font-weight: 700;
}

/* ✨ Sertifikat Glassmorphism */
.cert-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 3rem;
    padding: 2rem;
}

.cert-item {
    position: relative;
    overflow: hidden;
    border-radius: 1.5rem;
    border: 2px solid rgba(183, 75, 75, 0.4);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: 0.4s ease-in-out;
    cursor: pointer;
}

.cert-item img {
    width: 100%;
    border-radius: 1rem;
    transition: 0.5s ease-in-out;
}

/* 🌈 Glow Hover Effect */
.cert-item:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 0 25px #b74b4b;
}

/* 🔥 Light streak animation */
.cert-item::before {
    content: "";
    position: absolute;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.2), transparent);
    transform: rotate(25deg);
    transition: 0.7s;
}

.cert-item:hover::before {
    top: 100%;
    left: 100%;
}

/* 🔍 Popup Viewer Premium */
#certPopup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    justify-content: center;
    align-items: center;
    z-index: 999;
    animation: fadeIn 0.4s ease forwards;
}

#certPopup img {
    max-width: 90%;
    border-radius: 1.2rem;
    animation: zoom 0.4s ease forwards;
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}

@keyframes zoom {
    from {transform: scale(0.7);}
    to {transform: scale(1);}
}

/* ❌ Close Button Styling */
.close {
    position: absolute;
    top: 30px;
    right: 40px;
    font-size: 5rem;
    cursor: pointer;
    color: #fff;
    text-shadow: 0 0 10px #b74b4b;
    transition: 0.3s;
}

.close:hover {
    color: #b74b4b;
    transform: scale(1.1);
}


.cert-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 1rem;
    border: 2px solid #b74b4b;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    perspective: 1000px;
}

.cert-item img {
    width: 100%;
    height: auto;
    transform: rotateY(0deg);
    transition: transform 0.6s ease, filter 0.4s ease;
}

.cert-item:hover {
    transform: translateY(-10px) scale(1.03);
    box-shadow: 0 0 35px #b74b4b;
}

.cert-item:hover img {
    transform: rotateY(12deg) scale(1.1);
    filter: brightness(1.15);
}
