/*
  CSS Cleanup Summary:
  - Removed: legacy sections (services/resume/faq/testimonials/counters/pricing/blog), slider/demo, footer lama, button varian tak terpakai, utilities eksperimental.
  - Kept: global tokens, header, nav (desktop/mobile), hero, portfolio grid + filters, cards, section-title, scroll-top, preloader, footer, minor utilities.
  - Fonts: Roboto 300/400/500/700; Poppins 400/500/600; Space Grotesk 300–700.
  - Libraries aktif: Bootstrap, Bootstrap Icons, AOS, GLightbox, Isotope, imagesLoaded, Typed.js.
  - Visual parity: required; nilai token dari tampilan saat ini.
*/

/* ============================================================================ */
/* 0) TOKENS */
/* ============================================================================ */
:root {
  --color-bg: #e2e2e2;
  --color-bg-alt: #060606;
  --color-text: #bababa;
  --color-heading: #0a090f;
  --color-accent: #3071e9;
  --color-surface: #ffffff;
  --color-contrast: #ffffff;

  --radius-lg: 1rem;
  --shadow-md: 0 10px 24px rgba(0,0,0,.07);

  --section-pad: 30px;
  --gap-card: 1rem;
  --gap-body: .25rem;

  /* Back-compat tokens */
  --background-color: var(--color-bg);
  --default-color: var(--color-text);
  --heading-color: var(--color-heading);
  --accent-color: var(--color-accent);
  --surface-color: var(--color-surface);
  --contrast-color: var(--color-contrast);

  /* Nav palette */
  --nav-color: #ffffff;
  --nav-hover-color: #ffffff;
  --nav-mobile-background-color: #ffffff;
  --nav-dropdown-background-color: #ffffff;
  --nav-dropdown-color: #212529;
  --nav-dropdown-hover-color: #0078ff;

  scroll-behavior: smooth;
}

/* Contextual backgrounds */
.light-background {
  --background-color: #f9f9f9;
  --surface-color: #ffffff;
}
.dark-background {
  --background-color: var(--color-bg-alt);
  --default-color: #ffffff;
  --heading-color: #ffffff;
  --surface-color: #252525;
  --contrast-color: #ffffff;
}
.accent-background {
  --background-color: #0078ff;
  --default-color: #ffffff;
  --heading-color: #ffffff;
  --accent-color: #ffffff;
  --surface-color: #3393ff;
  --contrast-color: #ffffff;
}

/* ============================================================================ */
/* 1) GLOBAL BASICS */
/* ============================================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  color: var(--default-color);
  background-color: var(--background-color);
  font-family: "Roboto", system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, "Noto Sans","Liberation Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol","Noto Color Emoji";
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  font-family: "Space Grotesk", sans-serif;
  margin-top: 0;
}

/* Links */
a {
  color: var(--accent-color);
  text-decoration: none;
  transition: color .3s ease;
}
a:hover { color: color-mix(in srgb, var(--accent-color), transparent 25%); }

/* Focus visibility */
:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent-color), transparent 0%);
  outline-offset: 2px;
}

/* Heading → paragraph rhythm */
h1 + p, h2 + p, h3 + p { margin-top: var(--gap-body); }

/* ============================================================================ */
/* 2) HEADER */
/* ============================================================================ */
.header {
  --background-color: #000000;
  --default-color: #ffffff;
  --heading-color: #ffffff;

  color: var(--default-color);
  background-color: var(--background-color);
  padding: 15px 0;
  transition: all .5s;
  z-index: 997;
}
.header .logo { line-height: 1; }
.header .logo img { max-height: 32px; margin-right: 8px; }
.header .logo h1 { font-size: 30px; margin: 0; font-weight: 700; color: var(--heading-color); }
.scrolled .header { box-shadow: 0 0 18px rgba(0, 0, 0, 0.1); }

/* ============================================================================ */
/* 3) NAVIGATION (desktop & mobile) */
/* Safelist states: .active, .show, .open, .collapsed */
/* ============================================================================ */
/* Desktop */
@media (min-width: 1200px) {
  .navmenu { padding: 0; }
  .navmenu ul { margin: 0; padding: 0; display: flex; list-style: none; align-items: center; }
  .navmenu li { position: relative; }
  .navmenu>ul>li { white-space: nowrap; padding: 15px 14px; }
  .navmenu>ul>li:last-child { padding-right: 0; }

  .navmenu a, .navmenu a:focus {
    color: var(--nav-color);
    font-size: 15px;
    padding: 0 2px;
    font-family: "Poppins", sans-serif;
    font-weight: 400;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    transition: .3s;
    position: relative;
  }
  .navmenu a i, .navmenu a:focus i { font-size: 12px; line-height: 0; margin-left: 5px; transition: .3s; }

  .navmenu>ul>li>a:before {
    content: "";
    position: absolute;
    height: 2px;
    bottom: -6px;
    left: 0;
    background-color: var(--nav-hover-color);
    visibility: hidden;
    width: 0;
    transition: all .3s ease-in-out;
    right: 0;
  }
  .navmenu a:hover:before,
  .navmenu li:hover>a:before,
  .navmenu .active:before { visibility: visible; width: 100%; }
  .navmenu li:hover>a,
  .navmenu .active,
  .navmenu .active:focus { color: var(--nav-hover-color); }
}

/* Mobile */
@media (max-width: 1199px) {
  .mobile-nav-toggle { color: var(--nav-color); font-size: 28px; line-height: 0; margin-right: 10px; cursor: pointer; transition: color .3s; }
  .navmenu { padding: 0; z-index: 9997; }
  .navmenu ul {
    display: none; list-style: none; position: absolute; inset: 60px 20px 20px 20px;
    padding: 10px 0; margin: 0; border-radius: 6px; background-color: var(--nav-mobile-background-color);
    border: 1px solid color-mix(in srgb, var(--default-color), transparent 90%);
    box-shadow: none; overflow-y: auto; transition: .3s; z-index: 9998;
  }
  .navmenu a, .navmenu a:focus {
    color: var(--nav-dropdown-color); padding: 10px 20px; font-family: "Poppins", sans-serif;
    font-size: 17px; font-weight: 500; display: flex; align-items: center; justify-content: space-between;
    white-space: nowrap; transition: .3s;
  }
  .navmenu a i, .navmenu a:focus i {
    font-size: 12px; line-height: 0; margin-left: 5px; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: .3s;
    background-color: color-mix(in srgb, var(--accent-color), transparent 90%);
  }
  .navmenu a i:hover, .navmenu a:focus i:hover { background-color: var(--accent-color); color: var(--contrast-color); }
  .navmenu a:hover, .navmenu .active, .navmenu .active:focus { color: var(--nav-dropdown-hover-color); }
  .navmenu .active i, .navmenu .active:focus i { background-color: var(--accent-color); color: var(--contrast-color); transform: rotate(180deg); }

  .mobile-nav-active { overflow: hidden; }
  .mobile-nav-active .mobile-nav-toggle { color: #fff; position: absolute; font-size: 32px; top: 15px; right: 15px; margin-right: 0; z-index: 9999; }
  .mobile-nav-active .navmenu { position: fixed; overflow: hidden; inset: 0; background: rgba(33, 37, 41, 0.8); transition: .3s; }
  .mobile-nav-active .navmenu>ul { display: block; }
}

/* ============================================================================ */
/* 4) FOOTER */
/* ============================================================================ */
.footer {
  color: var(--default-color);
  background-color: var(--background-color);
  font-size: 14px;
  padding: 40px 0;
  position: relative;
  text-align: center;
}
.footer .social-links {
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.footer .social-links a {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 30%);
  font-size: 22px; color: #c5c5c5;
  transition: .3s;
}
.footer .social-links a:hover {
  color: var(--default-color);
  border-color: var(--default-color);
}
.footer .credits { margin-top: 10px; font-size: 13px; }
.footer .credits a { color: color-mix(in srgb, var(--default-color), transparent 30%); }

/* ============================================================================ */
/* 5) PRELOADER & SCROLL TOP */
/* ============================================================================ */
#preloader {
  position: fixed; inset: 0; z-index: 999999; overflow: hidden;
  background: var(--background-color); transition: all .6s ease-out;
}
#preloader:before {
  content: ""; position: fixed; top: calc(50% - 30px); left: calc(50% - 30px);
  border: 6px solid #ffffff; border-color: var(--accent-color) transparent var(--accent-color) transparent;
  border-radius: 50%; width: 60px; height: 60px; animation: animate-preloader 1.5s linear infinite;
}
@keyframes animate-preloader { 0% { transform: rotate(0deg);} 100% { transform: rotate(360deg);} }

.scroll-top, #scroll-top {
  position: fixed; visibility: hidden; opacity: 0; right: 15px; bottom: -15px; z-index: 99999;
  background-color: var(--accent-color); width: 44px; height: 44px; border-radius: 50px; transition: all .4s;
  display: flex; align-items: center; justify-content: center;
}
.scroll-top i, #scroll-top i { font-size: 24px; color: var(--contrast-color); line-height: 0; }
.scroll-top:hover, #scroll-top:hover { background-color: color-mix(in srgb, var(--accent-color), transparent 20%); color: var(--contrast-color); }
.scroll-top.active, #scroll-top.active { visibility: visible; opacity: 1; bottom: 15px; }

/* ============================================================================ */
/* 6) SECTIONS + TITLES */
/* ============================================================================ */
section, .section {
  color: var(--default-color);
  background-color: var(--background-color);
  padding-block: var(--section-pad);
  scroll-margin-top: 80px;
  overflow: clip;
}
@media (max-width: 1199px) { section, .section { scroll-margin-top: 76px; } }

.section-title { text-align: center; padding-bottom: 60px; position: relative; }
.section-title h2 {
  font-size: 32px; font-weight: 700; margin-bottom: 20px; padding-bottom: 20px; position: relative;
}
.section-title h2:after {
  content: ""; position: absolute; display: block; width: 50px; height: 3px;
  background: var(--accent-color); left: 0; right: 0; bottom: 0; margin: auto;
}
.section-title p { margin-bottom: 0; }

/* About page tighter rhythm */
.about-page .section .section-title { margin-bottom: .5rem !important; }
.about-page .section .section-title h2 { margin-bottom: .25rem; }
.about-page #about-me .section-title + p { margin-top: 0; }

/* ============================================================================ */
/* 7) HERO */
/* ============================================================================ */
.hero {
  width: 100%;
  min-height: calc(100vh - 92px);
  position: relative;
  padding: 60px 0;
  display: flex; align-items: center; justify-content: center;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.hero:before { content: ""; background: color-mix(in srgb, var(--background-color), transparent 65%); position: absolute; inset: 0; z-index: 2; }
.hero .container { position: relative; z-index: 3; }
.hero h1 { margin: 0; font-size: 24px; font-weight: 700; }
.hero h2 { margin: 0; font-size: 64px; font-weight: 700; }
.hero p { margin: 5px 0 0 0; font-size: 25px; font-weight: 400; font-family: "Space Grotesk", sans-serif; }
@media (max-width: 768px) { .hero h2 { font-size: 32px; } }

/* Social links in hero */
.hero .social-links { display: flex; align-items: center; gap: 12px; }
.hero .social-links a { font-size: 25px; color: #b2b2b2; transition: color .3s; }
.hero .social-links a:hover { color: #ffffff; }

/* ============================================================================ */
/* 8) PORTFOLIO (filters + cards) */
/* Safelist: .portfolio-item, .filter-btn, .geoscience, .gis, .data, .consulting, #portfolio-grid */
/* ============================================================================ */
.portfolio .portfolio-filters {
  padding: 0; margin: 0 auto 20px auto; list-style: none; text-align: center;
}
.portfolio .portfolio-filters li,
.portfolio .portfolio-filters .filter-btn {
  cursor: pointer; display: inline-block; padding: 0; font-size: 16px; font-weight: 600;
  margin: 0 10px; line-height: 1; text-transform: uppercase; margin-bottom: 5px; transition: all .3s ease-in-out;
}
.portfolio .portfolio-filters li:hover,
.portfolio .portfolio-filters .filter-btn:hover,
.portfolio .portfolio-filters .filter-active { color: var(--accent-color); }
@media (max-width: 575px) {
  .portfolio .portfolio-filters li,
  .portfolio .portfolio-filters .filter-btn { font-size: 14px; margin: 0 5px; }
}
.portfolio .portfolio-item { position: relative; }

/* ============================================================================ */
/* 9) RESEARCH LAB */
/* ============================================================================ */
#research .lab-figure img { border-radius: var(--radius-lg); }
#research .lab-copy h2 { font-size: 32px; font-weight: 700; }
#research .lab-copy p { font-size: 16px; margin-bottom: 16px; }

/* ============================================================================ */
/* 10) ABOUT PREVIEW (index) */
/* ============================================================================ */
.about-preview img { max-width: 160px; border-radius: 999px; }
.about-preview h2 { font-size: 28px; font-weight: 700; }
.about-preview p { font-size: 15px; }

/* ============================================================================ */
/* 11) CARDS + MICRO-INTERACTION */
/* ============================================================================ */
.card, .border.rounded-3 { transition: transform .18s ease, box-shadow .18s ease; }
.card:hover, .border.rounded-3:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
img.card-img-top { display: block; width: 100%; height: auto; border-top-left-radius: .375rem; border-top-right-radius: .375rem; }

/* Grid gap helper */
.cards-grid { gap: var(--gap-card); }

/* ============================================================================ */
/* 12) UTILITIES */
/* ============================================================================ */
hr.my-0 { border: 0; height: 1px; background: linear-gradient(90deg, rgba(0,0,0,.08), rgba(0,0,0,.02)); }

#library a.d-block { transition: all .2s; }
#library a.d-block:hover { border-color: #00d084; box-shadow: 0 0 0 2px rgba(0, 208, 132, .15); }

@media (max-width: 768px) { [data-aos-delay] { transition-delay: 0 !important; } }

/* ============================================================================ */
/* 13) SAFELIST (do not remove; used by libs or future states) */
/* ============================================================================ */
/* .active, .is-active, .open, .show, .hidden, .visually-hidden, .sr-only,
   .portfolio-item, #portfolio-grid, .filter-btn,
   .geoscience, .gis, .data, .consulting,
   .glightbox, .isotope, .isotope-item,
   .bi
*/

/* Footer override */
footer.footer {
  --background-color: #111111;
  --default-color: #f1f1f1;
  --heading-color: #ffffff;
  --accent-color: #ffffff;
}

/* About underline alignment */
@media (min-width: 768px) {
  .about-page .section .section-title { text-align: left; }
  .about-page .section .section-title h2::after { left: 0; right: auto; margin: 0; }
}

/* About spacing */
.about-page .section .section-title {
  padding-bottom: 20px;
  margin-bottom: .5rem;
  text-align: left;
}
.about-page .section .section-title h2 {
  margin-bottom: .25rem;
  padding-bottom: 0;
}
.about-page #about-me p:first-of-type,
.about-page #education p:first-of-type { margin-top: 0; }

/* ============================================================================ */
/* 14) ACTIVITY SCROLLER */
/* ============================================================================ */
.activity-scroller {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: var(--activity-gap, 1rem);
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.activity-scroller .activity-card { flex: 0 0 280px; scroll-snap-align: start; }
@media (min-width: 576px) { .activity-scroller .activity-card { flex-basis: 320px; } }
@media (min-width: 992px) { .activity-scroller .activity-card { flex-basis: 360px; } }
.activity-scroller .activity-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: .75rem;
}

/* ============================================================================ */
/* 15) PORTFOLIO GRID WIDTH FIXES (Isotope + Bootstrap) */
/* ============================================================================ */
#portfolio-grid { position: relative; }
#portfolio-grid .portfolio-item { box-sizing: border-box; }
@media (max-width: 767.98px) { #portfolio-grid .portfolio-item { width: 100%; } }
@media (min-width: 768px) and (max-width: 1199.98px) { #portfolio-grid .portfolio-item { width: 50%; } }
@media (min-width: 1200px) { #portfolio-grid .portfolio-item { width: 33.3333%; } }

/* ============================================================================ */
/* 16) MOBILE NAV TOGGLE POLISH */
/* ============================================================================ */
.mobile-nav-toggle {
  border: none;
  background: transparent;
  font-size: 1.8rem;
  color: #fff;
  transition: transform .3s ease, color .3s ease;
}
.mobile-nav-toggle:hover { color: var(--accent-color); }
.mobile-nav-active .mobile-nav-toggle {
  color: var(--accent-color);
  transform: rotate(90deg);
}
