/* ==========================================================================
   1. GLOBAL VARIABLES & RESET
   ========================================================================== */
:root {
  --primary-yellow: #FFCC00;
  --primary-hover: #e6b800;
  --bg-dark: #0f0f11;
  --card-bg: #18181c;
  --card-border: #26262e;
  --text-main: #f5f5f7;
  --text-muted: #9a9ab0;
  --header-height: 70px;
  --max-content-width: 1200px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  padding-top: var(--header-height);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* ==========================================================================
   2. NAVBAR & DESKTOP MENU
   ========================================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: rgba(15, 15, 17, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--card-border);
  z-index: 100;
}

.nav-container {
  max-width: var(--max-content-width);
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Brand Logo */
.brand-logo {
  display: flex;
  flex-direction: column;
}

.brand-logo .brand-name {
  font-size: 1.6rem;
  font-weight: 900;
  font-style: italic;
  color: #000;
  background: var(--primary-yellow);
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1;
}

.brand-logo .brand-sub {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 3px;
  margin-top: 3px;
  text-transform: uppercase;
}

/* Desktop Links */
.nav-links-desktop {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-item {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.nav-item:hover { color: var(--primary-yellow); }

/* Toggle Button */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 18px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001; /* Stays above navbar */
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease, background-color 0.3s ease;
}

.menu-toggle.open .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
  background-color: var(--primary-yellow);
}

.menu-toggle.open .hamburger-line:nth-child(2) { opacity: 0; }

.menu-toggle.open .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
  background-color: var(--primary-yellow);
}

/* ==========================================================================
   3. MOBILE SLIDE-OVER DRAWER
   ========================================================================== */
.mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background-color: var(--card-bg);
  border-left: 1px solid var(--card-border);
  padding: calc(var(--header-height) + 20px) 30px 40px 30px;
  z-index: 999;
  transition: right 0.3s ease-in-out;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
}

.mobile-drawer.open {
  right: 0;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawer-item {
  color: var(--text-main);
  font-size: 1.2rem;
  font-weight: 600;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: block;
  width: 100%;
}

.drawer-item:hover {
  color: var(--primary-yellow);
}

/* Overlay Backdrop */
.menu-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.menu-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   4. CARDS, BUTTONS & SECTIONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
}

.btn-primary { background-color: var(--primary-yellow); color: #000; }
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border: 1px solid var(--card-border);
}

.btn-outline:hover {
  border-color: var(--primary-yellow);
  color: var(--primary-yellow);
}

.badge {
  display: inline-block;
  background: rgba(255, 204, 0, 0.1);
  color: var(--primary-yellow);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(255, 204, 0, 0.2);
}

.section-container {
  padding: 60px 20px;
  max-width: var(--max-content-width);
  margin: 0 auto;
  width: 100%;
}

.section-header { margin-bottom: 40px; }
.section-title { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 8px; }
.section-desc { color: var(--text-muted); font-size: 1rem; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
}

.project-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.project-img-wrapper {
  width: 100%;
  height: 200px;
  background-color: #111115;
  border-bottom: 1px solid var(--card-border);
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-details {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.project-header h3 { font-size: 1.25rem; margin-bottom: 10px; }
.project-desc { color: var(--text-muted); font-size: 0.92rem; margin-bottom: 20px; flex-grow: 1; }
.project-links-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: auto; }

footer {
  text-align: center;
  padding: 30px 20px;
  border-top: 1px solid var(--card-border);
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

/* ==========================================================================
   5. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 768px) {
  .nav-links-desktop { display: none; }
  .menu-toggle { display: flex; }
  .mobile-drawer { display: block; }
  .menu-backdrop { display: block; }
  .section-container { padding: 40px 16px; }
  .projects-grid { grid-template-columns: 1fr; }
}

/* Ensure drawer stays hidden on screens larger than 768px */
@media (min-width: 769px) {
  .mobile-drawer,
  .mobile-drawer.open,
  .menu-backdrop,
  .menu-backdrop.open,
  .menu-toggle {
    display: none !important;
  }
}