/* ======== CSS Variables ======== */
:root {
    --dark-navy: #0a192f;
    --navy: #112240;
    --light-navy: #233554;
    --lightest-navy: #303C55;
    --navy-shadow: rgba(2, 12, 27, 0.7);
    --slate: #8892b0;
    --light-slate: #a8b2d1;
    --lightest-slate: #ccd6f6;
    --white: #e6f1ff;
    --green: #64ffda;
    --green-tint: rgba(100, 255, 218, 0.1);

    --font-sans: 'Poppins', -apple-system, system-ui, sans-serif;
    --font-mono: 'Fira Code', 'Monaco', monospace;

    --fz-xxl: 3.5rem;
    --fz-xl: 2.5rem;
    --fz-lg: 1.8rem;
    --fz-md: 1.2rem;
    --fz-sm: 0.9rem;
    --fz-xs: 0.8rem;

    --border-radius: 4px;
    --nav-height: 100px;

    --transition: all 0.25s cubic-bezier(0.645, 0.045, 0.355, 1);
}

/* ======== Reset & Global ======== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--dark-navy);
    color: var(--slate);
    font-family: var(--font-sans);
    font-size: var(--fz-md);
    line-height: 1.6;
}

main {
    padding: 0 150px;
}

section {
    min-height: 80vh;
    padding: 100px 0;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

a {
    color: var(--green);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    filter: brightness(1.2);
}

ul {
    list-style: none;
}

/* ======== Section Title ======== */
.section-title {
    font-size: var(--fz-xl);
    color: var(--lightest-slate);
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.section-title span {
    color: var(--green);
    font-family: var(--font-mono);
    font-size: var(--fz-lg);
    margin-right: 10px;
    font-weight: 400;
}

.section-title::after {
    content: '';
    width: 300px;
    height: 1px;
    margin-left: 20px;
    background-color: var(--light-navy);
}

/* ======== Header & Nav ======== */
header {
    position: sticky;
    top: 0;
    z-index: 11;
    background-color: rgba(10, 25, 47, 0.85);
    backdrop-filter: blur(10px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 50px;
    height: var(--nav-height);
}

.logo a {
    font-family: var(--font-mono);
    font-size: var(--fz-lg);
    font-weight: bold;
    border: 2px solid var(--green);
    padding: 8px 12px;
    border-radius: var(--border-radius);
}

.nav-links {
    display: flex;
    align-items: center;
}

.nav-links li {
    margin: 0 20px;
    font-family: var(--font-mono);
    font-size: var(--fz-sm);
}

.nav-links a {
    color: var(--lightest-slate);
}

.nav-links a.active {
    color: var(--green);
}

.burger {
    display: none;
    cursor: pointer;
}

.burger div {
    width: 25px;
    height: 2px;
    background-color: var(--green);
    margin: 5px;
    transition: all 0.3s ease;
}

/* ======== Sidebars ======== */
.left-sidebar, .right-sidebar {
    width: 40px;
    position: fixed;
    bottom: 0;
    z-index: 10;
    color: var(--light-slate);
}

.left-sidebar { left: 40px; }
.right-sidebar { right: 40px; }

.social-media, .email-link {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.social-media::after, .email-link::after {
    content: '';
    width: 1px;
    height: 90px;
    margin: 20px auto 0;
    background-color: var(--light-slate);
}

.social-media li { margin: 10px 0; }

.social-media a svg,
.email-link a {
    color: var(--slate);
    transition: var(--transition);
    font-family: var(--font-mono);
    font-size: var(--fz-xs);
    letter-spacing: 0.1em;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Khusus left sidebar: putar teks agar menghadap ke kanan */
.left-sidebar .email-link a {
    transform: rotate(180deg);
    transform-origin: center;
}

.social-media a:hover svg,
.email-link a:hover {
    color: var(--green);
    transform: translateY(-3px);
}

/* Agar hover di left-sidebar tetap konsisten */
.left-sidebar .email-link a:hover {
    transform: rotate(180deg) translateY(-3px);
}

/* ======== Hero ======== */
#hero {
    min-height: 100vh;
}

#hero .intro {
    color: var(--green);
    font-family: var(--font-mono);
    font-size: var(--fz-md);
    margin-bottom: 20px;
}

#hero .name, #hero .subtitle {
    font-size: var(--fz-xxl);
    font-weight: 700;
    margin-bottom: 10px;
}

#hero .name { color: var(--lightest-slate); }
#hero .subtitle { color: var(--slate); margin-bottom: 30px; }

#hero .description {
    max-width: 540px;
    margin-bottom: 50px;
}

.cta-button {
    font-family: var(--font-mono);
    font-size: var(--fz-sm);
    color: var(--green);
    background: transparent;
    border: 1px solid var(--green);
    border-radius: var(--border-radius);
    padding: 1.25rem 1.75rem;
    cursor: pointer;
    transition: var(--transition);
}

.cta-button:hover {
    background-color: var(--green-tint);
}

/* ======== About ======== */
.about-content {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 50px;
}

.about-text p {
    margin-bottom: 15px;
}

.about-image {
    position: relative;
    max-width: 300px;
}

.image-wrapper {
    position: relative;
    width: 100%;
    border-radius: var(--border-radius);
    background: var(--green);
}

.image-wrapper::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--green);
    border-radius: var(--border-radius);
    z-index: -1;
    transition: var(--transition);
}

.image-wrapper:hover::after {
    top: 10px;
    left: 10px;
}

.about-image img {
    width: 100%;
    border-radius: var(--border-radius);
    mix-blend-mode: multiply;
    filter: grayscale(100%) contrast(1);
    transition: var(--transition);
}

.about-image:hover img {
    mix-blend-mode: normal;
    filter: none;
}

/* ======== Skills ======== */
#skills {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

#skills .section-title {
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.skill-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
}

.skill-card img {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
}

.skill-info h3 {
    font-size: 1rem;
    color: #fff;
    margin: 0 0 4px 0;
}

.skill-info span {
    font-size: 0.85rem;
    color: #aaa;
}

/* ======== Stats ======== */
.stats-section {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin: 50px auto 30px;
    text-align: center;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease, background 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
    background: var(--green-tint);
}

.stat-icon, .stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--green);
    margin-bottom: 5px;
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--light-slate);
    letter-spacing: 0.5px;
}

/* ======== Projects ======== */
.projects-grid {
    display: grid;
    gap: 70px;
}

.project-card {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: center;
    gap: 10px;
}

.project-card:nth-of-type(odd) .project-content { grid-column: 7 / -1; text-align: right; }
.project-card:nth-of-type(odd) .project-image { grid-column: 1 / 8; }
.project-card:nth-of-type(even) .project-content { grid-column: 1 / 7; }
.project-card:nth-of-type(even) .project-image { grid-column: 6 / -1; }

.project-content { z-index: 2; }
.project-image { z-index: 1; }

.project-overline {
    color: var(--green);
    font-family: var(--font-mono);
    font-size: var(--fz-sm);
    margin-bottom: 10px;
}

.project-title {
    font-size: var(--fz-lg);
    margin-bottom: 20px;
}

.project-title a {
    color: var(--lightest-slate);
}

.project-description {
    background-color: var(--light-navy);
    padding: 25px;
    border-radius: var(--border-radius);
    color: var(--light-slate);
    font-size: var(--fz-sm);
    box-shadow: 0 10px 30px -15px var(--navy-shadow);
    margin-bottom: 20px;
}

.project-tech-list {
    display: flex;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: var(--fz-xs);
    margin-bottom: 10px;
}

.project-card:nth-of-type(odd) .project-tech-list {
    justify-content: flex-end;
}

.project-tech-list li {
    margin: 0 0 5px 20px;
}

.project-card:nth-of-type(odd) .project-tech-list li {
    margin: 0 20px 5px 0;
}

.project-links a {
    margin: 0 10px;
}

.project-links svg {
    width: 22px;
    height: 22px;
    color: var(--light-slate);
    transition: var(--transition);
}

.project-links a:hover svg {
    color: var(--green);
}

.project-image a {
    display: block;
    width: 100%;
    height: 100%;
    background-color: var(--green);
    border-radius: var(--border-radius);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius);
    mix-blend-mode: multiply;
    filter: grayscale(100%) contrast(1) brightness(80%);
    transition: var(--transition);
}

.project-image a:hover img {
    filter: none;
    mix-blend-mode: normal;
}

/* ======== Contact ======== */
#contact {
    text-align: center;
    max-width: 600px;
}

.section-title-contact {
    font-family: var(--font-mono);
    font-size: var(--fz-md);
    color: var(--green);
    margin-bottom: 20px;
}

.contact-title {
    font-size: 3rem;
    color: var(--lightest-slate);
    margin-bottom: 20px;
}

.contact-text {
    margin-bottom: 50px;
}

/* === Artikel Section === */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.article-card {
  background: #111; /* sesuai dark theme */
  border: 1px solid #1f2937;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.article-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.article-content {
  padding: 1.2rem;
}

.article-title a {
  color: #e5e7eb;
  font-family: 'Fira Code', monospace;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.article-title a:hover {
  color: #38bdf8; /* aksen biru */
}

.article-excerpt {
  color: #9ca3af;
  font-size: 0.9rem;
  margin: 0.75rem 0 1rem;
  line-height: 1.5;
}

.read-more {
  color: #38bdf8;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

.read-more:hover {
  color: #0ea5e9;
}

/* === Fade-in Animation (reusable) === */
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* === Fade-in Animation (reusable) === */
.fade-in-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* ======== Footer ======== */
footer {
    text-align: center;
    padding: 30px 20px;
    font-family: var(--font-mono);
    font-size: var(--fz-xs);
    color: var(--slate);

    /* === Tambahan penting === */
    background-color: var(--dark-navy); /* pastikan variabel ini sudah didefinisikan */
    box-sizing: border-box;             /* biar padding tidak bikin overflow */
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.footer-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--slate);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 255, 218, 0.2);
    transition: all 0.3s ease;
}

.footer-social a:hover {
    color: var(--green);
    background: var(--green-tint);
    transform: translateY(-3px);
    border-color: var(--green);
}

.footer-social svg {
    width: 18px;
    height: 18px;
}

/* ======== Animations ======== */
.fade-in-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-section.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ======== Responsive: Artikel ======== */
@media (max-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
  }

  .article-image img {
    height: 160px;
  }
}

@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr 1fr; /* 2 kolom di tablet */
    gap: 1.2rem;
  }

  .article-image img {
    height: 150px;
  }
}

@media (max-width: 600px) {
  .articles-grid {
    grid-template-columns: 1fr; /* 1 kolom di HP */
    gap: 1rem;
  }

  .article-card {
    margin: 0 auto;
    max-width: 95%;
  }

  .article-image img {
    height: 140px;
  }
}

@media (max-width: 400px) {
  .article-image img {
    height: 120px;
  }

  .article-title a {
    font-size: 1rem;
  }

  .article-excerpt {
    font-size: 0.85rem;
  }
}

/* =======================
   🔹 Responsive Global
   ======================= */

/* 🔸 Layar ≤1200px (Laptop besar) */
@media (max-width: 1200px) {
  main {
    padding: 0 80px;
  }
  section {
    padding: 80px 0;
  }
}

/* 🔸 Layar ≤992px (Tablet landscape) */
@media (max-width: 992px) {
  main {
    padding: 0 50px;
  }

  .about-content {
    grid-template-columns: 1fr; /* About menjadi 1 kolom */
    gap: 30px;
    text-align: center;
  }

  .left-sidebar,
  .right-sidebar {
    display: none; /* sembunyikan sidebar di tablet */
  }

  nav {
    padding: 0 30px;
  }
}

/* 🔸 Layar ≤768px (Tablet portrait) */
@media (max-width: 768px) {
  section {
    padding: 60px 0;
  }

  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
  }

  .projects-grid {
    gap: 40px;
  }

  .project-card {
    grid-template-columns: 1fr; /* Project jadi 1 kolom */
  }

  .project-card:nth-of-type(odd) .project-content,
  .project-card:nth-of-type(even) .project-content {
    grid-column: 1 / -1;
    text-align: left;
  }

  .project-card:nth-of-type(odd) .project-image,
  .project-card:nth-of-type(even) .project-image {
    grid-column: 1 / -1;
  }

  /* Navigasi mobile */
  .nav-links {
    display: none; /* sembunyikan menu default */
  }
  .burger {
    display: block;
  }
}

/* 🔸 Layar ≤600px (HP besar) */
@media (max-width: 600px) {
  main {
    padding: 0 20px;
  }

  .section-title::after {
    width: 100px;
  }

  #hero .name,
  #hero .subtitle {
    font-size: 2rem;
  }

  .stats-section {
    gap: 20px;
  }

  .skills-grid {
    grid-template-columns: 1fr 1fr; /* 2 kolom di HP besar */
  }
}

/* 🔸 Layar ≤400px (HP kecil) */
@media (max-width: 400px) {
  .skills-grid {
    grid-template-columns: 1fr; /* 1 kolom di HP kecil */
  }

  .section-title {
    font-size: 1.3rem;
  }

  .cta-button {
    padding: 1rem 1.2rem;
    font-size: 0.8rem;
  }
}
