/* ============================================================
   Zalif Portfolio - style.css
   Full stylesheet: navbar (desktop + mobile sidebar), layout,
   components, animations, and responsive rules.
   ============================================================ */

/* ===== IMPORTS & RESET ===== */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;500;600;700;800&display=swap");

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 45.5%;
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  color: #e9f6ff;
  min-height: 100vh;
  background: url("background.jpg") center/cover no-repeat fixed;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* overlay to dim background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 10, 20, 0.62);
  backdrop-filter: blur(1px);
  z-index: -1;
}
/* ===== GLOBAL UTILITIES ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 6%;
}

/* links */
a {
  color: inherit;
  text-decoration: none;
  outline: none;
}

a:focus {
  outline: 3px solid rgba(0, 255, 255, 0.15);
  outline-offset: 3px;
  border-radius: 6px;
}

/* text helpers */
.section-title {
  text-align: center;
  font-size: 4rem;
  margin-bottom: 3.5rem;
  color: #e9f6ff;
  text-shadow: 0 0 12px rgba(0, 255, 255, 0.08);
}
.section-title span {
  color: cyan;
  text-shadow: 0 0 12px cyan;
}

/* button */
.btn {
  display: inline-block;
  padding: 1rem 2.4rem;
  border-radius: 40px;
  border: 2px solid rgba(0, 255, 255, 0.24);
  color: cyan;
  font-weight: 600;
  letter-spacing: 0.08rem;
  background: transparent;
  transition: transform 200ms ease, box-shadow 200ms ease, background 200ms ease;
}
.btn:hover,
.btn:focus {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 255, 255, 0.08);
  background: rgba(0, 255, 255, 0.05);
}

/* ===== NAVBAR ===== */
nav {
  position: fixed;
  inset: 0 0 auto 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6%;
  z-index: 1600; /* patched */
  transition: background 300ms ease, height 200ms ease, box-shadow 200ms ease;
  background: linear-gradient(
    180deg,
    rgba(0, 15, 30, 0.28),
    rgba(0, 15, 30, 0.14)
  );
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(0, 255, 255, 0.04);
}
/* elevated navbar when scrolling */
nav.scrolled {
  background: linear-gradient(
    180deg,
    rgba(0, 10, 20, 0.85),
    rgba(0, 10, 20, 0.95)
  );
  box-shadow: 0 6px 30px rgba(0, 0, 0, 0.45);
  height: 64px;
}

/* logo */
.logo {
  font-size: 2.8rem;
  font-weight: 800;
  color: cyan;
  letter-spacing: 0.04rem;
  text-shadow: 0 0 8px cyan, 0 0 20px rgba(0, 80, 160, 0.15);
}

/* nav links container (desktop) */
nav header {
  display: flex;
  gap: 2.2rem;
  align-items: center;
}

/* nav link style */
nav header a {
  font-size: 1.7rem;
  color: #e9f6ff;
  padding: 0.4rem 0.2rem;
  position: relative;
  transition: color 160ms ease, transform 160ms ease;
}

nav header a:hover,
nav header a:focus {
  color: cyan;
  transform: translateY(-3px);
}

/* active underline glow */
nav header a.active::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 3px;
  border-radius: 10px;
  background: linear-gradient(90deg, cyan, #0078ff);
  box-shadow: 0 0 18px cyan, 0 0 36px rgba(0, 120, 255, 0.15);
  animation: glowPulse 1.6s ease-in-out infinite alternate;
}

@keyframes glowPulse {
  from {
    box-shadow: 0 0 10px cyan;
  }
  to {
    box-shadow: 0 0 26px cyan, 0 0 48px rgba(0, 120, 255, 0.12);
  }
}

/* Hamburger (hidden on desktop) */
.menu-toggle {
  display: none;
  width: 42px;
  height: 36px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: transparent;
  border-radius: 8px;
  transition: transform 180ms ease;
}

/* hamburger bars */
.menu-toggle span {
  display: block;
  width: 28px;
  height: 3px;
  background: cyan;
  border-radius: 3px;
  transform-origin: center;
  transition: transform 220ms ease, opacity 220ms ease;
}

.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 1500; /* below menu */
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}

.nav-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

/* ===== MOBILE SIDEBAR (hidden by default) =====
   We'll move header (nav links) to a fixed sidebar in mobile
   when .show is toggled by JS. */
nav header.mobile {
  display: none;
}

/* ===== SECTIONS ===== */
section {
  padding: 8rem 6% 6rem;
  min-height: calc(100vh - 80px);
}

/* HOME */
.home {
  display: grid;
  grid-template-columns: 45% 55%;
  gap: 3.2rem;
  align-items: center;
  padding-top: 8.6rem; /* leave space for fixed nav */
}

.home-img {
  position: relative;
  display: inline-block;
}

.home-img::before {
  content: "";
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(0, 255, 255, 0.4) 0%,
    transparent 70%
  );
  z-index: -1;
  filter: blur(40px);
  animation: auraPulse 4s ease-in-out infinite alternate;
}

@keyframes auraPulse {
  from {
    transform: scale(1);
    opacity: 0.6;
  }
  to {
    transform: scale(1.1);
    opacity: 0.9;
  }
}

.home-img img {
  width: 100%;
  max-width: 14000px;
  object-fit: contain;
  /* Efek glow cyan */
  filter: drop-shadow(0 0 18px rgba(0, 255, 255, 0.6))
    drop-shadow(0 0 28px rgba(0, 180, 255, 0.35));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.home-img img:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 25px cyan)
    drop-shadow(0 0 40px rgba(0, 180, 255, 0.5));
}

.home-content h1 {
  font-size: 6rem;
  line-height: 1.05;
  color: #ffffff;
  margin-bottom: 0.6rem;
  text-shadow: 0 0 12px rgba(0, 200, 255, 0.06),
    0 0 26px rgba(0, 100, 200, 0.04);
}

.home-content h1 span {
  color: cyan;
  text-shadow: 0 0 14px cyan;
}

.typing-text {
  font-size: 3.4rem;
  font-weight: 600;
  margin-bottom: 1rem;
  min-width: 240px;
  color: #cff9ff;
}

/* small decorative cursor line handled in HTML/CSS animations */
.typing-text span::before {
  content: "Web Developer";
  color: cyan;
  animation: words 20s infinite;
}

@keyframes words {
  0%,
  20% {
    content: "Web Developer";
  }
  21%,
  40% {
    content: "Frontend Engineer";
  }
  41%,
  60% {
    content: "UI/UX Designer";
  }
  61%,
  80% {
    content: "Creative Coder";
  }
  81%,
  100% {
    content: "Fantasy Builder";
  }
}

/* social icons */
.social-icons {
  margin: 2rem 0;
  display: flex;
  gap: 1rem;
  align-items: center;
}
.social-icons a {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(0, 255, 255, 0.12);
  color: cyan;
  font-size: 1.6rem;
  transition: transform 180ms ease, background 180ms ease, box-shadow 180ms ease;
}
.social-icons a:hover,
.social-icons a:focus {
  background: cyan;
  color: #00121a;
  transform: translateY(-6px) scale(1.08);
  box-shadow: 0 8px 30px rgba(0, 255, 255, 0.08),
    0 0 40px rgba(0, 120, 255, 0.06);
}

/* SERVICES */
.services-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.6rem;
}

.service-card {
  background: linear-gradient(
    180deg,
    rgba(0, 15, 30, 0.62),
    rgba(0, 15, 30, 0.4)
  );
  border-radius: 14px;
  padding: 1.8rem;
  text-align: center;
  border: 1px solid rgba(0, 255, 255, 0.06);
  box-shadow: 0 10px 30px rgba(0, 12, 25, 0.45);
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.service-card i {
  font-size: 3.6rem;
  color: cyan;
  margin-bottom: 0.8rem;
  text-shadow: 0 0 10px cyan;
}
.service-card h3 {
  font-size: 2rem;
  margin-bottom: 0.6rem;
}
.service-card p {
  color: #cbdcec;
  font-size: 1.35rem;
  line-height: 1.45;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(0, 50, 120, 0.18);
  border-color: rgba(0, 255, 255, 0.12);
}

/* SKILLS + EDUCATION layout */
.skills-education {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.6rem;
}

/* skills column */
.skills-column,
.education-column {
  background: rgba(0, 15, 30, 0.5);
  padding: 1.8rem;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 12, 25, 0.46);
}

/* skill bars */
.skill {
  margin-bottom: 1.6rem;
}
.skill-name {
  font-size: 1.6rem;
  color: cyan;
  margin-bottom: 0.6rem;
  text-shadow: 0 0 6px cyan;
}
.skill-bar {
  background: rgba(0, 10, 20, 0.65);
  border-radius: 10px;
  height: 2.6rem;
  overflow: hidden;
  border: 1px solid rgba(0, 255, 255, 0.06);
}
.skill-progress {
  height: 100%;
  background: linear-gradient(90deg, cyan, #0078ff);
  text-align: right;
  padding-right: 0.8rem;
  font-weight: 700;
  color: #00121a;
  animation: progressGlow 2.6s ease-in-out infinite alternate;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
@keyframes progressGlow {
  0% {
    box-shadow: 0 0 6px rgba(0, 255, 255, 0.08);
  }
  100% {
    box-shadow: 0 0 18px rgba(0, 255, 255, 0.18);
  }
}
.skill-desc {
  margin-top: 0.5rem;
  color: #cbdcec;
  font-size: 1.25rem;
}

/* education items */
.education-item {
  padding: 1rem;
  border-left: 3px solid cyan;
  margin-bottom: 1.2rem;
  background: linear-gradient(
    180deg,
    rgba(0, 15, 30, 0.54),
    rgba(0, 15, 30, 0.35)
  );
  border-radius: 8px;
}
.edu-year {
  color: cyan;
  font-size: 1.3rem;
}

/* EXPERIENCE & PROJECTS (two-column) */
.experience-projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.4rem;
}

.experience-item,
.project-card {
  background: rgba(0, 15, 30, 0.56);
  padding: 1.4rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 255, 0.04);
  box-shadow: 0 10px 30px rgba(0, 12, 25, 0.45);
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.experience-item:hover,
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(0, 20, 60, 0.26);
}

/* project card */
.project-card h3 {
  color: cyan;
  font-size: 1.9rem;
  margin-bottom: 0.6rem;
}
.project-card p {
  color: #cbdcec;
  font-size: 1.35rem;
  margin-bottom: 0.8rem;
}
.tech-used {
  font-style: italic;
  color: #8ff4ff;
}

/* CONTACT */
.contact {
  text-align: center;
  padding-bottom: 8rem; /* More space at the bottom */
}

.contact-intro {
  font-size: 1.6rem;
  color: #cbdcec;
  margin-bottom: 4rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.contact-container {
  display: grid;
  grid-template-columns: 1fr 2fr; /* Info on left, form on right */
  gap: 4rem;
  max-width: 1000px;
  margin: 0 auto;
  text-align: left;
  background: rgba(0, 15, 30, 0.5);
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(0, 12, 25, 0.46);
  border: 1px solid rgba(0, 255, 255, 0.06);
}

.contact-info h3,
.contact-form h3 {
  font-size: 2.4rem;
  color: cyan;
  margin-bottom: 2rem;
  text-shadow: 0 0 8px cyan;
}

.contact-info p {
  font-size: 1.5rem;
  color: #e9f6ff;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.contact-info p i {
  color: cyan;
  font-size: 1.8rem;
}

.contact-social {
  margin-top: 2.5rem;
  justify-content: flex-start; /* Align social icons to the left */
}

.contact-form .form-group {
  margin-bottom: 2rem;
}

.contact-form label {
  display: block;
  font-size: 1.4rem;
  color: #cff9ff;
  margin-bottom: 0.8rem;
  font-weight: 500;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  width: 100%;
  padding: 1.2rem 1.5rem;
  background: rgba(0, 10, 20, 0.7);
  border: 1px solid rgba(0, 255, 255, 0.1);
  border-radius: 8px;
  color: #e9f6ff;
  font-size: 1.5rem;
  font-family: "Poppins", sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
  border-color: cyan;
  box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
  outline: none;
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.contact-form .btn {
  width: auto;
  padding: 1.2rem 3rem;
  font-size: 1.6rem;
  margin-top: 1.5rem;
  cursor: pointer;
  border: 2px solid cyan;
  background: rgba(0, 255, 255, 0.08);
  color: cyan;
}

.contact-form .btn:hover {
  background: cyan;
  color: #00121a;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
  transform: translateY(-2px);
}

/* fade-in base for IntersectionObserver */
.fade-in-up {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 720ms ease, transform 720ms ease;
}
.fade-in-up.show {
  opacity: 1;
  transform: translateY(0);
}

/* fade delay utilities */
.fade-delay-1 {
  transition-delay: 0.08s;
}
.fade-delay-2 {
  transition-delay: 0.16s;
}
.fade-delay-3 {
  transition-delay: 0.24s;
}
.fade-delay-4 {
  transition-delay: 0.32s;
}
.fade-delay-5 {
  transition-delay: 0.4s;
}
.fade-delay-6 {
  transition-delay: 0.48s;
}

/* ===== RESPONSIVE ===== */

/* Tablet and smaller screens */
@media (max-width: 995px) {
  .container {
    padding: 0 5%;
  }
  .home {
    grid-template-columns: 1fr;
    padding-top: 10.2rem;
    text-align: center;
    gap: 2.2rem;
  }
  .home-img img {
    max-width: 60vw;
  }

  .skills-education,
  .experience-projects {
    grid-template-columns: 1fr;
  }

  .service-card {
    padding: 1.6rem;
  }
  .section-title {
    font-size: 3.6rem;
    margin-bottom: 2.4rem;
  }

  .contact-container {
    grid-template-columns: 1fr; /* Stack columns on smaller screens */
    padding: 2.5rem;
  }
  .contact-info {
    text-align: center;
  }
  .contact-info p {
    justify-content: center; /* Center contact details */
  }
  .contact-social {
    justify-content: center; /* Center social icons */
  }
  .contact-form {
    text-align: center; /* Center form elements */
  }
  .contact-form .btn {
    width: 100%; /* Full width button */
  }
}

/* Mobile / small devices */
@media (max-width: 768px) {
  nav {
    padding: 0 4%;
    height: 64px;
  }

  .menu-toggle {
    display: flex;
  }

  nav header {
    position: fixed;
    top: 0;
    right: 0;
    width: 290px;
    height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.6rem;
    padding: 2.8rem 1.2rem;
    background: linear-gradient(
      180deg,
      rgba(0, 12, 25, 0.98),
      rgba(0, 12, 25, 0.92)
    );
    backdrop-filter: blur(8px);
    border-left: 1px solid rgba(0, 255, 255, 0.04);
    transform: translateX(100%); /* Adjusted for smoother animation */
    transition: transform 320ms cubic-bezier(0.2, 0.9, 0.2, 1);
    z-index: 1700; /* menu above overlay */
    display: flex;
  }

  nav header.show {
    transform: translateX(0);
  }

  nav header a {
    font-size: 2rem;
    display: block;
    padding: 0.8rem 1rem;
    width: 100%;
    text-align: center;
    color: #d7f6ff;
  }

  nav .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
  }
  nav .menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-8px);
  }
  nav .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    z-index: 1200;
    display: none;
    transition: opacity 300ms ease;
  }
  .nav-overlay.show {
    display: block;
    opacity: 1;
  }

  /* show hamburger */
  .menu-toggle {
    display: flex;
  }
  /* hide regular header, we'll use the same header but styled as sidebar */

  /* shrink home fonts */
  .home-content h1 {
    font-size: 4.4rem;
  }
  .typing-text {
    font-size: 2.4rem;
  }
  .section-title {
    font-size: 3.2rem;
  }
}

/* Very small phones */
@media (max-width: 420px) {
  html {
    font-size: 40%;
  }

  nav {
    height: 56px;
  }

  nav header {
    width: 100%;
    max-width: none;
    border-left: none;
  }

  .logo {
    font-size: 2.2rem;
  }

  .home-content h1 {
    font-size: 3.8rem;
  }

  .typing-text {
    font-size: 2rem;
  }

  .service-card i {
    font-size: 3rem;
  }

  .service-card h3 {
    font-size: 1.6rem;
  }

  .contact-container {
    padding: 2rem;
  }
  .contact-info h3,
  .contact-form h3 {
    font-size: 2rem;
  }
  .contact-info p,
  .contact-form label,
  .contact-form input,
  .contact-form textarea {
    font-size: 1.4rem;
  }
  .contact-form .btn {
    font-size: 1.4rem;
    padding: 1rem 2rem;
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto;
  }
}

/* Small utility spacing for sections anchor top offset (for fixed nav) */
.anchor-offset {
  display: block;
  height: 84px;
  margin-top: -84px;
  visibility: hidden;
}
