@import url('https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400..700&display=swap');

/* ==========================================================================
MODERN CSS BOILERPLATE
- Resets default browser styles for consistency.
- Establishes a design system using CSS Custom Properties (Variables).
- Provides sensible defaults for typography, spacing, and components.
========================================================================== */

/* ==========================================================================
1. CSS RESET & BOX MODEL
========================================================================== */

/*
- Set box-sizing to border-box for all elements for a more intuitive
box model calculation (width/height will include padding and border).
- Reset default margins and paddings for a clean slate.
*/
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ==========================================================================
2. :ROOT VARIABLES (DESIGN TOKENS)
========================================================================== */

/*
Define all reusable design values here.
This is the "single source of truth" for colors, fonts, and spacing.
*/
:root {
  /* 🎨 COLORS (Color Palette) */
  --clr-bg: #121212;             /* Off-black background */
  --clr-border: #333333;         /* Dark gray for borders and dividers */
  --clr-secondary: #27272a;      /* Slightly lighter gray for secondary elements */
  --clr-accent: #ffffff;         /* Pure white for strong hover effects or links */
  
  /* Text Colors */
  --clr-text-primary: #e9e9e9;    /* Light gray (almost white)for primary text and headings */
  --clr-text-secondary: #a0a0a0; /* Softer gray for secondary text */
  
  /* Global Assignments */
  --clr-background: var(--clr-bg);
  /* --clr-text: var(--clr-text-primary); */
  
  /* ✒️ TYPOGRAPHY (Fonts & Type Scale) */
  --font-family-base: 'Segoe UI', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-family-heading: var(--font-family-base);
  --font-pxlify: 'Pixelify Sans', sans-serif;
  
  /* Type Scale (1rem = 16px by default) */
  --font-xs: 0.625rem;    /* 10px */
  --font-sm: 0.875rem;    /* 14px */
  --font-base: 1rem;      /* 16px */
  --font-md: 1.125rem;    /* 18px */
  --font-lg: 1.25rem;     /* 20px */
  --font-xl: 1.75rem;     /* 28px */
  --font-xxl: 2.25rem;    /* 36px */
  
  /* 📏 SPACING (Spacing Scale) */
  --space-xs: 0.5rem;     /* 8px */
  --space-sm: 1rem;       /* 16px */
  --space-md: 1.5rem;     /* 24px */
  --space-lg: 2rem;       /* 32px */
  --space-xl: 4rem;       /* 64px */
  
  /* 🔲 OTHER STYLES (Radius, Shadow, Transition) */
  --radius-sm: 0.25rem;    /* 4px */
  --radius-md: 0.5rem;     /* 8px */
  --radius-lg: 1rem;       /* 16px */
  --radius-full: 9999px;
  
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  --transition-fast: all 0.2s ease-in-out;
  
  --content-width: 70ch; /* Based on root font */
  /* Mobile-first content widths */
  --content-width-mobile: 100%;
  --content-width-tablet: 65ch;
  --content-width-desktop: 70ch;
  
  /* Mobile-first spacing */
  --container-padding: 1.5rem; /* 24px padding untuk mobile */
}

/* ==========================================================================
3. GLOBAL STYLES (BASE STYLES)
========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-base); /* 16px */
  line-height: 1.6;
  color: var(--clr-text-primary);
  background-color: var(--clr-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: grid;
  grid-template-columns: var(--container-padding) 1fr var(--container-padding);
  
}

/* Target semua anak langsung dari body (header, main, footer) 
untuk menempati kolom kedua (tengah)
*/
body > * {
  grid-column: 2;
}

main {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl)
}

/* Common heading styles */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family-heading);
  font-weight: 600; /* Explicitly set to bold */
  line-height: 1.3;
  margin-bottom: var(--space-sm); /* 16px */
  color: var(--clr-text-primary);
}

/* Specific font sizes for each heading level to create a clear hierarchy */
h1 { font-size: var(--font-xxl); } /* 36px */
h2 { font-size: var(--font-xl); }  /* 28px */
h3 { font-size: var(--font-lg); }  /* 20px */
h4 { font-size: var(--font-md); }  /* 18px */
h5 { font-size: var(--font-base); font-weight: 600; } /* 16px */
h6 { font-size: var(--font-sm); font-weight: 600; } /* 14px */        

p { 
  margin-bottom: var(--space-sm); /* 16px */
  color: var(--clr-text-secondary); 
}

a { 
  color: var(--clr-text-primary); 
  text-decoration: none; 
  transition: var(--transition-fast);
}

a:hover { color: var(--clr-accent); }

strong, b {
  font-weight: 600;
  color: var(--clr-text-primary);
  opacity: .85;  
}
img, picture, video, canvas, svg { 
  display: block; 
  max-width: 100%; 
}

/* ==========================================================================
4. UTILITY & COMPONENT STYLES
========================================================================== */
.container {
  width: 90%;
  max-width: var(--content-width);
  margin-inline: auto;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1.5rem;       /* 8px 20px, reduced horizontal padding */
  font-size: var(--font-sm);   /* 14px, smaller font */
  font-family: var(--font-family-base);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
  
  background-color: transparent;
  border: 1px solid var(--clr-border);
  color: var(--clr-text-primary);
}

.btn:hover {
  background-color: var(--clr-text-primary);
  border-color: var(--clr-text-primary);
  color: var(--clr-bg);
}

.rounded-sm { border-radius: var(--radius-sm); } /* 4px */
.rounded-md { border-radius: var(--radius-md); } /* 8px */
.rounded-lg { border-radius: var(--radius-lg); } /* 16px */
.rounded-full { border-radius: var(--radius-full); }

.pixelify-font {
  font-family: var(--font-pxlify);
  font-weight: 400; /* Normal weight */
  font-style: normal;
}

/* ==========================================================================
4.1. NAVIGATION COMPONENT - Fixed Bottom Navigation
========================================================================== */

/**
* Main Navigation Container
* - Fixed bottom navigation with glassmorphism effect
* - Uses backdrop-filter for modern blur effect behind nav
* - Responsive font sizing with clamp() for optimal readability
* - High z-index to stay above all other content
*/
.main-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  justify-self: center;
  
  /* Glassmorphism Effect */
  background: rgba(39, 39, 42, 0.21);        /* Semi-transparent dark background */
  backdrop-filter: blur(14px);               /* Modern blur effect */
  -webkit-backdrop-filter: blur(14px);       /* Safari compatibility */
  border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle border for definition */
  
  /* Layout & Positioning */
  border-radius: var(--radius-full);         /* Pill-shaped container */
  box-shadow: var(--box-shadow);             /* Subtle depth */
  padding: var(--space-sm) var(--space-md);  /* 16px vertical, 24px horizontal */
  position: fixed;                           /* Stays in viewport */
  bottom: var(--space-lg);                   /* 32px from bottom */
  z-index: 1000;                             /* Above all other content */
  
  /* Responsive Typography */
  font-size: clamp(var(--font-xs), calc(var(--font-xs) + 0.7vw), var(--font-md));
}

/**
* Navigation List
* - Horizontal flex layout for nav items
* - Removes default list styling
* - Consistent spacing between items
*/
.nav-list {
  display: flex;
  gap: var(--space-md);
  list-style: none;
}

/**
* Navigation Links - Contrast Solution
* Problem: White text becomes invisible on light/white backgrounds
* Solution: Dark text-shadow provides contrast on any background color
* - First shadow: 8px blur with 50% opacity for strong outline
* - Second shadow: 16px blur with 20% opacity for subtle glow effect
* This ensures text remains readable on both dark and light backgrounds
*/
.nav-list a {
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.5), 
               0 0 16px rgba(0, 0, 0, 0.2);
  transition: var(--transition-fast);
}

/* ==========================================================================
5. COMPONENT STYLES - PROFILE SECTION
========================================================================== */

/**
* Profile Container
* - Uses flexbox layout that adapts from mobile (column) to desktop (row)
* - Contains profile picture, name, title, and contact information
*/
.profile-container {
  display: flex;
  flex-direction: column; /* Mobile first: stack elements vertically */
  gap: var(--space-sm);
  text-align: left;
  border-radius: var(--border-radius);
  margin-block: var(--space-md);
}

.profile-name {
  font-size: var(--font-md);
  color: var(--clr-text-primary);
  margin-bottom: var(--space-xs);
}

/**
* Profile Title
* - Displays job title/role with company link
* - Uses flexbox for icon and text alignment
* - Prevents line breaking with white-space: nowrap
*/
.profile-title {
  font-size: var(--font-sm);
  color: var(--clr-text-secondary);
  margin-bottom: 0;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* Company link styling within profile title */
.profile-title a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Company icon styling - inverted for dark theme */
.profile-title img {
  vertical-align: middle;
  flex-shrink: 0;
  filter: invert(1); /* White icon on dark background */
}

.about-content {
  /* font-size: var(--font-sm); */
  line-height: 1.6;
  color: var(--clr-text-secondary);
  margin-bottom: var(--space-lg);
}

/* Profile picture styling - circular avatar */
.profile-pic {
  width: 77px;
  height: 77px;
  object-fit: cover;
  border-radius: var(--radius-full);
}

/* Domain badge - small pill-shaped indicator */
.domain-address {
  font-size: var(--font-xs);
  color: var(--clr-text-secondary);
  margin-left: var(--space-xs);
  background-color: #1e1e1e;
  padding: 0.25em 0.7em;
  border-radius: var(--radius-full);
  font-weight: lighter;
  vertical-align: middle;
}

/* Container for call-to-action buttons and social links */
.action-links {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Primary button variant - white background on dark theme */
.btn--primary {
  background-color: var(--clr-accent);
  color: var(--clr-bg);
  border-color: var(--clr-accent);
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.btn--primary:hover {
  opacity: 0.9;
}

/* Social media icons container */
.social-icons {
  display: flex;
  gap: var(--space-xs);
}

/* Individual social media icon styling */
.social-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 36px;
  height: 36px;
  background-color: var(--clr-secondary);
  border-radius: var(--radius-full);
  color: var(--clr-text-primary);
  transition: var(--transition-fast);
}

.social-icon:hover {
  opacity: 0.8;
}

/* Ensures SVG icons inherit color from parent */
.social-icon svg {
  stroke: currentColor; /* Mengambil warna dari 'color' di .social-icon */
}
/* ==========================================================================
6. COMPONENT STYLES - EXPERIENCE SECTION
========================================================================== */

.experience-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

/**
* Experience Item Card
* - Displays work experience in card format
* - Uses flexbox for responsive layout
* - Includes hover effects for interactivity
*/
.experience-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: var(--clr-background);
  border: 1px solid var(--clr-border);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  margin-block-end: var(--space-sm);
}

.experience-item:last-child {
  margin-block-end: 0;
}

/* Left content container for company and role information */
.experience-item-content-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

/* Reset margins for headings and paragraphs in experience items */
.experience-item h3, .experience-item p {
  margin: 0;
}

/* Company name styling */
.experience-item-company {
  /* font-size: var(--font-sm); */
  font-size: var(--font-md);
  color: var(--clr-text-primary);
}

/* Job role/title styling */
.experience-item-role {
  /* font-size: var(--font-xs); */
  font-size: var(--font-sm);
  color: var(--clr-text-secondary);
}

/* Employment dates styling */
.experience-item-dates {
  /* font-size: var(--font-xs); */
  font-size: calc(var(--font-xs) + 0.7vw);
  color: var(--clr-text-secondary);
}

/* ==========================================================================
7. COMPONENT STYLES - PROJECT SECTION
========================================================================== */

.project-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/**
* Project Card
* - Individual project container with image and content
* - Flexible layout that adapts from single column to grid on desktop
*/
.project-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

/* Project image container with rounded corners and overflow hidden */
.project-image-wrapper {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.project-image-wrapper img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* Container for project info and action button */
.project-content-wrapper{
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

/* Project title and tech stack styling */
.project-title, .project-tech {
  color: var(--clr-text-primary);
  margin: 0
}

.project-title {
  font-size: var(--font-md);
}

.project-tech {
  font-size: var(--font-sm);
  color: var(--clr-text-secondary);
}

/* ==========================================================================
8. COMPONENT STYLES - CONTACT SECTION
========================================================================== */

.contact-section {
  display: flex;
  flex-direction: column;
}

/**
* Contact Form
* - Responsive form layout with flexbox
* - Adapts from stacked mobile layout to side-by-side desktop layout
*/
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Form row container - mobile: column, desktop: row */
.form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Individual form field container */
.form-group {
  /* Mengatur agar label berada di atas input/textarea */
  display: flex;
  flex-direction: column;
  gap: var(--space-xs); /* Jarak antara label dan input/textarea */
  width: 100%; /* Memastikan setiap grup mengisi ruang yang tersedia */
}

/* Form input and textarea styling */
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem; /* 12px */
  font-family: var(--font-family-base);
  font-size: var(--font-base); /* 16px */
  color: var(--clr-text-primary);
  background-color: transparent;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md); /* 8px */
  transition: var(--transition-fast);
}

/* Focus state styling for form inputs */
.contact-form input:focus,
.contact-form textarea:focus {
  /* Beri highlight saat input di-klik/aktif */
  outline: none;
  border-color: var(--clr-accent);
}

/* Form label styling */
.contact-form label {
  font-size: var(--font-sm); /* 14px */
  color: var(--clr-text-secondary);
}

/* Submit button styling within form */
.contact-form .btn {
  padding: 0.75rem 1.5rem; /* 12px 24px */
}

/* ==========================================================================
9. COMPONENT STYLES - FOOTER SECTION
========================================================================== */

.footer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: var(--space-xl) 0 var(--space-md) 0;  
  color: var(--clr-text-secondary);
  font-size: var(--font-xs);
}

.footer-section p {
  margin-bottom: var(--space-xs);
}

.footer-section p:first-child {
  margin: 0
}

/* ==========================================================================
10. ANIMATIONS & HOVER EFFECTS
========================================================================== */

/* Animation */ 
.experience-item, .project-image-wrapper > img {
  transition: var(--transition-fast)
}

/* Hover effects for experience items and project images */
.experience-item:hover, .project-image-wrapper>img:hover {
  transform: scale(1.02);
}

/* Project card hover effects for icons */
.project-open svg {
  transition: var(--transition-fast);
}

.project-list > a:hover .project-open svg {
  color: var(--clr-accent);
  stroke: var(--clr-accent);
  transform: translateX(2px) translateY(-2px); /* Optional: subtle movement effect */


}

/**
* Navigation Links Hover Effect
* - Switches to white glow for enhanced contrast on hover
* - Creates a subtle "lighting up" effect while maintaining readability
* - Provides clear visual feedback for user interaction
*/
.nav-list a:hover {
  text-shadow: 0 0 12px rgba(255, 255, 255, 0.5),
               0 0 24px rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
11. RESPONSIVE DESIGN - MEDIA QUERIES
========================================================================== */

/* Desktop Styles */
@media (width >= 768px) {
  /* Layout: 3-column grid with centered content */
  body {
    /* Definisikan 3 kolom: 
    - 1fr: ruang fleksibel di sisi
    - minmax(auto, 1100px): konten utama, lebar maks 1100px
    - 1fr: ruang fleksibel di sisi
    */
    grid-template-columns: 1fr minmax(auto, var(--content-width)) 1fr;
  }
  
  /* Profile: horizontal layout on desktop */
  .profile-container {
    flex-direction: row; /* Desktop */
    align-items: center;
  }
  
  /* Alternative grid layout for projects (commented out) */
  /* .project-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  } */
  
  /* Enhanced typography for larger screens */
  .experience-item-company {
    font-size: var(--font-md);
  }
  
  .experience-item-role {
    font-size: var(--font-sm);
  }
  .experience-item-dates {
    font-size: var(--font-sm);
  }
  
  /* Projects: 2-column layout on desktop */
  .project-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .project-list > a {
    flex: 1 1 calc(50% - var(--space-lg) / 2); /* Setiap card mengambil 50% lebar minus gap */
    min-width: 0; /* Mencegah overflow */
  }
  
  /* Form: horizontal layout for input fields */
  .form-row {
    flex-direction: row;
  }
}