/* Variables */
:root {
  --bg-color: #282c33;
  --text-color: #abb2bf;
  --accent-color: #c778dd;
  --white-color: #ffffff;
}

/* THEME SWITCHER: Matrix Mode */
body.matrix-mode {
  --bg-color: #0d0208;
  --text-color: #008f11;
  --accent-color: #00ff41;
  --white-color: #00ff41;
}
body.matrix-mode .hero-image {
  filter: grayscale(100%) brightness(80%) sepia(100%) hue-rotate(70deg)
    saturate(300%);
  border-color: var(--accent-color);
}
body.matrix-mode .project-card {
  background-color: rgba(0, 255, 65, 0.05);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  overflow-x: hidden;
  transition:
    background-color 0.5s ease,
    color 0.5s ease;
}

h1,
h2,
h3,
h4 {
  color: var(--white-color);
  font-family: "Fira Code", monospace;
}

a {
  color: var(--accent-color);
  text-decoration: none;
  transition: 0.3s ease;
}
a:hover {
  text-shadow: 0 0 8px var(--accent-color);
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30px 0;
  font-family: "Fira Code", monospace;
  position: relative;
}
.logo {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--white-color);
}
.logo span {
  color: var(--accent-color);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}
.nav-links a:hover {
  color: var(--white-color);
}

/* Hamburger */
.hamburger {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  z-index: 100;
}
.bar {
  width: 30px;
  height: 2px;
  background-color: var(--white-color);
  transition: all 0.3s ease;
}
.bar.short {
  width: 20px;
}
.hamburger.active .bar:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.hamburger.active .bar.short {
  width: 30px;
  transform: translateY(-5px) rotate(-45deg);
}

/* Hero */
#hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  padding: 40px 0;
}
.hero-text {
  flex: 1;
}
.typing-container {
  font-size: 3rem;
  margin-bottom: 10px;
  color: var(--white-color);
  font-family: "Fira Code", monospace;
  font-weight: 600;
}
.cursor {
  display: inline-block;
  width: 15px;
  height: 3rem;
  background-color: var(--accent-color);
  animation: blink 1s step-end infinite;
  vertical-align: bottom;
  margin-left: 5px;
}
@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}
#hero p {
  font-size: 1.1rem;
  max-width: 550px;
  margin-bottom: 30px;
}
.hero-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 10px 24px;
  font-family: "Fira Code", monospace;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: 0.3s;
}
.btn:hover {
  background-color: rgba(199, 120, 221, 0.1);
  box-shadow: 0 0 15px rgba(199, 120, 221, 0.3);
  color: var(--white-color);
}
body.matrix-mode .btn:hover {
  background-color: rgba(0, 255, 65, 0.1);
  box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}
.btn-outline {
  border-color: var(--text-color);
  color: var(--text-color);
}
.btn-outline:hover {
  border-color: var(--white-color);
  color: var(--white-color);
  box-shadow: none;
}
.hero-image-container {
  position: relative;
}
.hero-image {
  width: 280px;
  height: 280px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-color);
  box-shadow: 0 0 25px rgba(199, 120, 221, 0.2);
  filter: grayscale(20%);
  transition: 0.3s ease;
}
.hero-image:hover {
  filter: grayscale(0%);
  box-shadow: 0 0 35px rgba(199, 120, 221, 0.5);
  transform: scale(1.02);
}

/* Sections General */
section {
  padding: 80px 0;
}
.section-title {
  font-size: 2rem;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
}
.section-title::before {
  content: ">> ";
  color: var(--accent-color);
  margin-right: 10px;
}

/* Skills & GitHub Stats */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 40px;
}
.skill-badge {
  border: 1px solid var(--text-color);
  padding: 8px 16px;
  border-radius: 20px;
  font-family: "Fira Code", monospace;
  font-size: 0.9rem;
  transition: 0.3s;
}
.skill-badge:hover {
  border-color: var(--accent-color);
  color: var(--white-color);
  box-shadow: 0 0 10px rgba(199, 120, 221, 0.2);
}
.github-stats-box {
  border: 1px dashed #3b4048;
  padding: 20px;
  border-radius: 8px;
  display: inline-block;
  width: 100%;
  transition: border-color 0.3s;
}
.github-stats-box:hover {
  border-color: var(--accent-color);
}
.github-stats-box span {
  color: var(--text-color);
  font-size: 0.8rem;
}
.stats-grid {
  display: flex;
  gap: 30px;
  font-family: "Fira Code", monospace;
  font-size: 0.9rem;
  margin-top: 15px;
}
.stats-grid span {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--white-color);
}

/* Projects & Hover Snippet */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.project-card {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid #3b4048;
  padding: 20px;
  border-radius: 8px;
  transition: 0.3s ease;
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-5px);
}
.img-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  margin-bottom: 15px;
  border: 1px solid #3b4048;
  transition: 0.3s ease;
}
.project-card:hover .img-wrapper {
  border-color: var(--accent-color);
}
.project-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  opacity: 0.8;
  transition: 0.3s ease;
}
.project-card:hover .project-image {
  opacity: 0.3;
} /* Meredup saat dihover */
.code-snippet {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(40, 44, 51, 0.6);
  padding: 15px;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}
.code-snippet pre {
  color: var(--accent-color);
  font-family: "Fira Code", monospace;
  font-size: 0.75rem;
  white-space: pre-wrap;
}
.project-card:hover .code-snippet {
  opacity: 1;
}
.project-card h4 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}
.project-card p {
  font-size: 0.9rem;
  margin-bottom: 20px;
  flex-grow: 1;
}
.tech-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: "Fira Code", monospace;
  font-size: 0.8rem;
  color: #8a93a5;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px 0;
  border-top: 1px solid #3b4048;
  font-size: 0.9rem;
}
.footer-socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 15px;
  font-family: "Fira Code", monospace;
}
.footer-socials a {
  display: flex;
  align-items: center;
  gap: 5px;
}
.footer-socials a::before {
  content: "[";
  color: var(--text-color);
  transition: 0.3s;
}
.footer-socials a::after {
  content: "]";
  color: var(--text-color);
  transition: 0.3s;
}
.footer-socials a:hover::before,
.footer-socials a:hover::after {
  color: var(--accent-color);
}

/* VISUAL 3: Scroll Reveal Animation */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s ease;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* VISUAL 2: Preloader */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: #1e2127;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}
#loader-text {
  color: #c778dd;
  font-family: "Fira Code", monospace;
  font-size: 1.1rem;
  line-height: 1.8;
  max-width: 80%;
}
body.matrix-mode #preloader {
  background-color: #0d0208;
}
body.matrix-mode #loader-text {
  color: #00ff41;
}

/* VISUAL 1: Custom Cursor (Hanya aktif di PC/Mouse) */
.custom-cursor {
  display: none;
}
@media (hover: hover) and (pointer: fine) {
  body,
  a,
  button,
  .hamburger {
    cursor: none !important;
  }
  .custom-cursor {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 22px;
    height: 22px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999999;
    transform: translate(-50%, -50%);
    transition:
      width 0.2s,
      height 0.2s,
      background-color 0.2s;
    box-shadow: 0 0 10px rgba(199, 120, 221, 0.4);
  }
  .custom-cursor.hover {
    width: 35px;
    height: 35px;
    background-color: var(--accent-color);
    opacity: 0.2;
    border-style: dashed;
  }
}

/* Responsive Mobile */
@media (max-width: 768px) {
  .section-title {
    font-size: 1.4rem;
    word-break: break-word;
  }
  .hamburger {
    display: flex;
  }
  .nav-links {
    position: absolute;
    top: 80px;
    right: -250px;
    flex-direction: column;
    background-color: var(--bg-color);
    width: 200px;
    text-align: center;
    padding: 20px 0;
    border: 1px solid #3b4048;
    border-radius: 8px;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
    transition: right 0.4s ease;
    z-index: 99;
  }
  .nav-links.active {
    right: 15px;
  }
  .nav-links a {
    display: block;
    padding: 15px 0;
    width: 100%;
  }
  #hero {
    flex-direction: column-reverse;
    text-align: center;
    padding-top: 20px;
  }
  .hero-text p {
    margin: 0 auto 30px auto;
  }
  .hero-buttons {
    justify-content: center;
  }
  .typing-container {
    font-size: 1.8rem;
  }
  .cursor {
    height: 1.8rem;
  }
  .hero-image {
    width: 220px;
    height: 220px;
  }
  .stats-grid {
    flex-direction: column;
    gap: 10px;
  }
}

/* =========================================
   VISUAL 6: EASTER EGG OVERLAY
   ========================================= */
#easter-egg-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  width: 90%;
  max-width: 800px;
  height: 80vh;
  background-color: #1e2127;
  border: 1px solid var(--accent-color);
  border-radius: 8px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: 0.3s ease;
  box-shadow: 0 0 30px rgba(199, 120, 221, 0.4);
}
#easter-egg-modal.show {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}
.terminal-header {
  background-color: #282c34;
  padding: 10px 15px;
  border-bottom: 1px solid #3b4048;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px 8px 0 0;
}
.terminal-title {
  flex-grow: 1;
  text-align: center;
  color: #8a93a5;
  font-family: "Fira Code", monospace;
  font-size: 0.8rem;
}
#close-egg {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  font-family: "Fira Code", monospace;
  font-size: 1rem;
  transition: 0.2s;
}
#close-egg:hover {
  color: #ff5f56;
}
#egg-content {
  flex-grow: 1;
  position: relative;
  background-color: #000;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}
#egg-terminal {
  padding: 20px;
  color: #00ff41;
  font-family: "Fira Code", monospace;
  font-size: 0.9rem;
  white-space: pre-line;
}
#egg-iframe {
  width: 100%;
  height: 100%;
  display: none;
}
#egg-iframe.show {
  display: block;
}

/* =========================================
   PROJECT CARD ACTION BUTTONS (Live / GitHub)
   ========================================= */
.project-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.project-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--accent-color);
  color: var(--accent-color);
  padding: 6px 16px;
  font-family: "Fira Code", monospace;
  font-size: 0.8rem;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition: 0.3s ease;
  text-decoration: none;
}

.project-btn:hover {
  background-color: rgba(199, 120, 221, 0.15);
  box-shadow: 0 0 10px rgba(199, 120, 221, 0.3);
  color: var(--white-color);
  text-shadow: none;
}

/* Tombol alternatif (misalnya untuk GitHub/Cached) */
.project-btn.outline {
  border-color: #3b4048;
  color: var(--text-color);
}

.project-btn.outline:hover {
  border-color: var(--accent-color);
  color: var(--white-color);
  background-color: rgba(0, 0, 0, 0.2);
}
