/* === VARIABEL GLOBAL === */
:root {
    --primary-blue: #005A9C; 
    --dark-blue-brand: #002D4E; 
    --accent-color: #FFA500;
    --primary-red: #E53935;
    --bg-primary: #FFFFFF; 
    --bg-secondary: #f7fafc; 
    --text-primary: #2d3748;
    --text-headings: #002D4E; 
    --text-light: #FFFFFF; 
    --border-color: #e2e8f0;
    --card-bg: #FFFFFF; 
    --header-bg: #FFFFFF; 
    --shadow-color: rgba(0, 0, 0, 0.05);
}

body.dark-mode {
    --bg-primary: #1a202c; 
    --bg-secondary: #2d3748; 
    --text-primary: #e2e8f0;
    --text-headings: #FFFFFF; 
    --border-color: #4a5568; 
    --card-bg: #2d3748; 
    --header-bg: #2d3748;
    --shadow-color: rgba(0, 0, 0, 0.2);
    --dark-blue-brand: #1A202C;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body { 
    font-family: 'Montserrat', 'Arial', sans-serif; 
    line-height: 1.7; 
    background-color: var(--bg-primary); 
    color: var(--text-primary); 
    transition: background-color 0.3s, color 0.3s; 
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3 { color: var(--text-headings); font-weight: 700; transition: color 0.3s; }

h2 { text-align: center; margin-bottom: 48px; font-size: 2.25rem; }

section { padding: 80px 0; }

/* === [FIX] HEADER & NAVIGASI UNIVERSAL UNTUK SEMUA HALAMAN === */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    padding: 24px 0;
    transition: background-color 0.4s ease, box-shadow 0.4s ease, padding 0.4s ease;
    background-color: transparent; /* Mulai dengan transparan */
}
.header.scrolled {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px var(--shadow-color);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
}
.header .container { display: flex; justify-content: space-between; align-items: center; }
.logo { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; font-weight: 700; text-decoration: none; transition: color 0.4s ease; }
.logo-img { height: 48px; width: auto; }

.nav-menu .nav-list { list-style: none; display: flex; align-items: center; margin: 0; } 
.nav-menu li { margin-left: 32px; }
.nav-menu a { position: relative; text-decoration: none; font-weight: 600; transition: color 0.3s ease; padding-bottom: 5px; font-size: 1rem; }
.nav-menu a::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 2px; background-color: var(--primary-blue); transform: scaleX(0); transition: transform 0.3s ease; }
.nav-menu a:hover::after, .nav-menu a.active::after { transform: scaleX(1); }

/* Gaya Teks Awal Header (Transparan) */
.header:not(.scrolled) .logo, 
.header:not(.scrolled) .nav-menu a, 
.header:not(.scrolled) #theme-toggle { 
    color: var(--text-light); 
    text-shadow: 0 1px 3px rgba(0,0,0,0.3); 
}
.header:not(.scrolled) .hamburger-menu .bar { 
    background-color: var(--text-light); 
}

/* Gaya Teks Header Saat di-scroll */
.header.scrolled .logo { color: var(--primary-blue); text-shadow: none; }
.header.scrolled .nav-menu a { color: var(--text-primary); text-shadow: none; }
.header.scrolled .nav-menu a.active { color: var(--primary-blue); }
.header.scrolled #theme-toggle { color: var(--text-headings); text-shadow: none; }
body.dark-mode .header.scrolled #theme-toggle { color: var(--text-light); }
.header.scrolled .hamburger-menu .bar { background-color: var(--text-headings); }

#theme-toggle {
    background: none; border: none; cursor: pointer;
    padding: 5px; width: 40px; height: 40px; font-size: 1.5rem;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.3s ease, color 0.3s ease;
}
#theme-toggle:hover { transform: rotate(15deg); }

.hamburger-menu, .nav-overlay, .nav-list-mobile { display: none; }


/* PAGE HEADER (DISESUAIKAN UNTUK NAVBAR TRANSPARAN) */
.page-header { 
    background: 
        linear-gradient(rgba(0, 25, 45, 0.7), rgba(0, 25, 45, 0.7)),
        url('/asset/Gemini_Generated_Image_mr56xpmr56xpmr56.png') no-repeat center center;
    background-size: cover;
    text-align: center; 
    padding: 160px 0 80px 0; 
    margin-top: -97px; /* Disesuaikan dengan tinggi header awal */
}
.page-header h1 { 
    font-size: 3rem; 
    color: var(--text-light);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.timeline { max-width: 800px; margin: 0 auto; position: relative; }
.timeline::after { content: ''; position: absolute; width: 4px; background-color: var(--primary-blue); top: 0; bottom: 0; left: 50%; margin-left: -2px; border-radius: 2px; }
.timeline-item { padding: 10px 40px; position: relative; width: 50%; }
.timeline-item::after { content: ''; position: absolute; width: 24px; height: 24px; right: -12px; background-color: var(--bg-primary); border: 4px solid var(--primary-blue); top: 25px; border-radius: 50%; z-index: 1; transition: background-color 0.3s; }
.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }
.timeline-item:nth-child(even)::after { left: -12px; }
.timeline-content { padding: 24px; background-color: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 4px 20px var(--shadow-color); transition: all 0.3s ease; }
.timeline-item:hover .timeline-content { transform: scale(1.03); box-shadow: 0 10px 30px var(--shadow-color); }
.timeline-content h3 { font-size: 1.5rem; margin-bottom: 8px; color: var(--primary-blue); }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.gallery-item { border: 1px solid var(--border-color); border-radius: 12px; background-color: var(--card-bg); box-shadow: 0 4px 20px var(--shadow-color); overflow: hidden; transition: all 0.3s ease; }
.gallery-item:hover { transform: translateY(-8px); box-shadow: 0 10px 30px var(--shadow-color); }
.gallery-item img { width: 100%; height: 220px; object-fit: cover; display: block; }
.gallery-item p { padding: 16px; font-weight: 600; text-align: center; }

.footer { background-color: var(--dark-blue-brand); color: #a0aec0; padding: 60px 0 20px 0; transition: background-color 0.3s; }
.footer-grid { display: flex; justify-content: space-between; gap: 40px; margin-bottom: 40px; flex-wrap: wrap; }
.footer-col { flex: 1; min-width: 250px; }
.footer-col h4 { margin-bottom: 20px; color: var(--text-light); border-bottom: 2px solid var(--accent-color); padding-bottom: 8px; display: inline-block; font-size: 1.1rem; }
.footer-bottom { text-align: center; border-top: 1px solid #4a5568; padding-top: 24px; color: #718096; }

.fade-in { opacity: 0; transform: translateY(30px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.fade-in.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 992px) { 
    .nav-menu .nav-list { display: none; }
    .hamburger-menu { display: block; background: none; border: none; cursor: pointer; padding: 0; z-index: 1010; }
    .hamburger-menu .bar { display: block; width: 25px; height: 3px; margin: 5px auto; transition: all 0.3s ease-in-out; } 

    /* [FIX] Animasi Hamburger menjadi 'X' */
    .hamburger-menu.active .bar:nth-child(2) { opacity: 0; }
    .hamburger-menu.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger-menu.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    /* [FIX] Gaya Teks Menu Mobile menjadi Putih */
    .nav-list-mobile li a,
    #theme-toggle-mobile {
        color: var(--text-light);
        opacity: 0.9;
        transition: color 0.3s ease, opacity 0.3s ease;
    }
    .nav-list-mobile li a.active,
    .nav-list-mobile li a:hover {
        color: var(--accent-color);
        opacity: 1;
    }

    .nav-list-mobile {
        display: flex; list-style: none; position: fixed; 
        top: 0; right: -300px; width: 300px; height: 100vh; 
        background-color: var(--header-bg); flex-direction: column; 
        align-items: flex-start; padding: 60px 20px 20px 20px; 
        margin: 0; box-shadow: -5px 0 15px rgba(0,0,0,0.1); 
        transition: right 0.4s cubic-bezier(0.77, 0, 0.175, 1), background-color 0.3s; 
        z-index: 999;
    }
    .nav-list-mobile.active { right: 0; } 
    .nav-list-mobile li { width: 100%; margin: 0; padding: 0; border-bottom: 1px solid var(--border-color); } 
    .nav-list-mobile li:first-child { border-top: 1px solid var(--border-color); }
    .nav-list-mobile li a { display: block; padding: 15px 10px; font-weight: 600; font-size: 1rem; }
    .nav-list-mobile .mobile-theme-toggle { border-bottom: none; } 
    #theme-toggle-mobile { 
        background-color: transparent; border: none; padding: 15px 10px;
        width: 100%; text-align: left;
        cursor: pointer; font-size: 1rem; font-weight: 600;
        font-family: 'Montserrat', 'Arial', sans-serif;
    }

    .nav-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); z-index: 998; }
    .nav-overlay.active { display: block; }

    .timeline::after { left: 12px; }
    .timeline-item { width: 100%; padding-left: 50px; padding-right: 10px; }
    .timeline-item:nth-child(even) { left: 0; }
    .timeline-item::after, .timeline-item:nth-child(even)::after { left: 0; }
}

/* === OUR JOURNEY SECTION DENGAN BACKGROUND GAMBAR === */
.journey-section {
  position: relative;
  background: 
    linear-gradient(rgba(0, 45, 78, 0.6), rgba(0, 45, 78, 0.6)),
    url("/asset/Pekerja Mengoperasikan Mesin CNC di Pabrik.png") no-repeat center center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--text-light);
  padding: 100px 0;
  transition: background 0.5s ease-in-out, color 0.3s;
}

.journey-section h2 {
  color: var(--text-light);
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.journey-section .timeline-content {
  background-color: rgba(255, 255, 255, 0.9);
  color: var(--text-primary);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(6px);
}

/* === DARK MODE === */
body.dark-mode .journey-section {
  background: 
    linear-gradient(rgba(10, 10, 10, 0.7), rgba(10, 10, 10, 0.7)),
    url("/asset/Pekerja Mengoperasikan Mesin CNC di Pabrik.png") no-repeat center center;
  background-size: cover;
}

body.dark-mode .journey-section .timeline-content {
  background-color: rgba(45, 55, 72, 0.85);
  color: var(--text-light);
  border-color: rgba(255,255,255,0.1);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .journey-section {
    background-attachment: scroll;
    padding: 80px 0;
  }
}
