/**
* Saharansub Personal Brand Website
* Main Stylesheet (Vanilla CSS)
*/

/*--------------------------------------------------------------
# 1. Design System (CSS Variables)
--------------------------------------------------------------*/
:root {
  /* Colors */
  --color-white: #FFFFFF;
  --color-light-green: #90EE90;
  --color-surface: #f8f9fa;
  --color-earth-tone: #D2B48C;
  --color-vibrant-orange: #FFA500;
  --color-deep-blue: #00008B;
  --color-heading: #222222;
  --color-body: #444444;
  --color-body-light: #6c757d;
  --color-contrast-dark: #222222;
  --color-contrast-light: #FFFFFF;
  /* Fonts */
  --font-default: "Roboto", system-ui, sans-serif;
  --font-heading: "Raleway", sans-serif;
  --font-nav: "Poppins", sans-serif;
  /* Layout */
  --container-width: 1140px;
  --spacing-section: 60px;
  --header-height: 70px;
}

/*--------------------------------------------------------------
# 2. General Reset & Base Styles
--------------------------------------------------------------*/
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-default); color: var(--color-body); background-color: var(--color-white); }
a { color: var(--color-light-green); text-decoration: none; transition: color 0.3s; }
a:hover { color: color-mix(in srgb, var(--color-light-green), black 15%); }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); color: var(--color-heading); }
img { max-width: 100%; height: auto; display: block; }

/*--------------------------------------------------------------
# 3. Layout & Reusable Components
--------------------------------------------------------------*/
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 15px; }
section { padding: var(--spacing-section) 0; overflow: hidden; }
.section-title { text-align: center; padding-bottom: 40px; }
.section-title h2 { font-size: 32px; font-weight: 700; margin-bottom: 15px; padding-bottom: 15px; position: relative; }
.section-title h2::after { content: ''; position: absolute; display: block; width: 50px; height: 3px; background: var(--color-light-green); bottom: 0; left: 50%; transform: translateX(-50%); }

/*--------------------------------------------------------------
# 4. Page Components
--------------------------------------------------------------*/
#preloader { position: fixed; inset: 0; z-index: 9999; background: var(--color-white); display: grid; place-content: center; transition: opacity 0.5s, visibility 0.5s; }
#preloader::after { content: ""; width: 50px; height: 50px; border: 4px solid var(--color-body-light); border-top-color: var(--color-light-green); border-radius: 50%; animation: preloader-spin 1s linear infinite; }
#preloader.loaded { opacity: 0; visibility: hidden; }
@keyframes preloader-spin { to { transform: rotate(360deg); } }

.header { height: var(--header-height); padding: 15px 0; background: var(--color-white); transition: box-shadow 0.3s; position: sticky; top: 0; z-index: 997; }
.header.scrolled { box-shadow: 0 2px 15px rgba(0,0,0,0.1); }
.header .container { display: flex; justify-content: space-between; align-items: center; }
.header .logo { font-size: 30px; font-weight: 700; color: var(--color-heading); font-family: var(--font-heading); }

/* --- CORRECTED NAVIGATION STYLES --- */
.navmenu { display: none; }
.navmenu ul { list-style: none; }
.navmenu a { display: flex; align-items: center; font-family: var(--font-nav); color: var(--color-body); position: relative; }
.navmenu a i { font-size: 12px; }
.navmenu a.active, .navmenu a:hover { color: var(--color-light-green); }
.navmenu .toggle-dropdown { transition: transform 0.3s; }
.mobile-nav-toggle { display: block; font-size: 28px; cursor: pointer; background: none; border: none; color: var(--color-heading); z-index: 999; }
.mobile-nav-toggle .bi-x { display: none; }
.mobile-social-links { display: none; }

/* --- CORRECTED DESKTOP NAVIGATION & DROPDOWNS --- */
@media (min-width: 1024px) {
  .mobile-nav-toggle { display: none; }
  .navmenu { display: block; }
  .navmenu ul { display: flex; gap: 20px; align-items: center; }
  .navmenu li { white-space: nowrap; }
  .navmenu a { font-size: 14px; }
  .navmenu .dropdown { position: relative; }
  .navmenu .dropdown > a .toggle-dropdown { margin-left: 5px; }
  .navmenu .dropdown ul { display: block; position: absolute; left: 0; top: calc(100% + 15px); min-width: 220px; padding: 10px 0; background: var(--color-white); box-shadow: 0px 0px 30px rgba(0,0,0,0.1); border-radius: 4px; z-index: 99; transition: 0.3s; visibility: hidden; opacity: 0; }
  .navmenu .dropdown ul a { padding: 10px 20px; font-weight: 400; font-size: 14px; justify-content: flex-start; }
  .navmenu .dropdown:hover > ul { opacity: 1; top: 100%; visibility: visible; }
  .navmenu .dropdown:hover > a .toggle-dropdown { transform: rotate(180deg); }
  /* CORRECTED: Space between logo and nav menu */
  .header .logo { margin-right: 30px; }
}

/* --- FULLY CORRECTED MOBILE NAVIGATION --- */
body.mobile-nav-active { overflow: hidden; }
body.mobile-nav-active .navmenu {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  z-index: 998;
  padding: var(--header-height) 20px 40px 20px;
  text-align: center;
  overflow-y: auto;
}
body.mobile-nav-active .navmenu > ul { display: block; padding-top: 20px; }
body.mobile-nav-active .navmenu > ul > li { padding: 12px 0; }
body.mobile-nav-active .navmenu a { justify-content: center; font-size: 24px; }
body.mobile-nav-active .navmenu .dropdown.active > a .toggle-dropdown { transform: rotate(180deg); }
body.mobile-nav-active .navmenu .dropdown ul {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-in-out;
  background: rgba(0,0,0,0.03);
  border-radius: 4px;
  margin-top: 10px;
  padding: 0;
}
body.mobile-nav-active .navmenu .dropdown .dropdown-active {
  max-height: 500px;
  padding: 10px 0;
}
body.mobile-nav-active .navmenu ul a { font-size: 16px; padding: 8px 0; }
body.mobile-nav-active .mobile-nav-toggle { position: fixed; top: 20px; right: 15px; }
body.mobile-nav-active .mobile-nav-toggle .bi-list { display: none; }
body.mobile-nav-active .mobile-nav-toggle .bi-x { display: block; }
body.mobile-nav-active .mobile-social-links {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-top: 30px;
  padding-bottom: 20px;
  font-size: 22px;
}
body.mobile-nav-active .mobile-social-links a {
  color: var(--color-body-light);
}

/* --- Rest of the styles remain the same --- */
.hero { background-color: var(--color-surface); }
.hero .container { display: flex; flex-direction: column; align-items: center; gap: 40px; text-align: center; }
.hero-content h1 { font-size: 36px; font-weight: 700; line-height: 1.2; }
.hero-content #dynamic-tagline { color: var(--color-light-green); display: inline-block; transition: opacity 0.3s ease-in-out; }
.hero-content p { margin: 20px 0 30px; font-size: 20px; color: var(--color-body-light); }
.hero-cta-hub { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
.hero-cta-hub .cta-button { padding: 12px 25px; border-radius: 50px; font-family: var(--font-nav); font-weight: 500; color: var(--color-contrast-dark); transition: transform 0.3s, box-shadow 0.3s; }
.hero-cta-hub .cta-button:hover { transform: translateY(-3px); box-shadow: 0 4px 15px rgba(0,0,0,0.15); }
.hero-cta-hub .steam { background-color: var(--color-light-green); }
.hero-cta-hub .market { background-color: var(--color-deep-blue); color: var(--color-contrast-light); }
.hero-cta-hub .tech { background-color: var(--color-vibrant-orange); }
.hero-cta-hub .emobility { background-color: var(--color-earth-tone); }
.hero-visual img { border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); }
#impact-dashboard .container { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; text-align: center; }
.stat-item .counter { font-size: 42px; font-weight: 700; font-family: var(--font-heading); color: var(--color-light-green); display: block; }
.stat-item p { font-size: 16px; color: var(--color-body-light); }
.service-overview { background-color: var(--color-surface); }
.service-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
.service-card { background: var(--color-white); padding: 40px 30px; text-align: center; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.05); transition: transform 0.3s, box-shadow 0.3s; }
.service-card:hover { transform: translateY(-5px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.service-card .card-icon { font-size: 48px; color: var(--color-light-green); margin-bottom: 20px; }
.service-card h4 { font-size: 22px; font-weight: 600; margin-bottom: 15px; }
.insights-grid { display: grid; grid-template-columns: 1fr; gap: 30px; }
.insight-card { background: var(--color-white); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.05); overflow: hidden; transition: transform 0.3s, box-shadow 0.3s; display: flex; flex-direction: column; }
.insight-card:hover { transform: translateY(-5px); box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.insight-card .card-content { padding: 25px; flex-grow: 1; }
.insight-card .category { display: block; color: var(--color-body-light); font-size: 14px; margin-bottom: 10px; }
.insight-card h3 { font-size: 20px; }
.insight-card h3 a { color: var(--color-heading); }
.insight-card h3 a:hover { color: var(--color-light-green); }
.footer { background-color: var(--color-surface); text-align: center; font-size: 14px; padding: 40px 0; }
.footer .social-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 15px; }
.footer .social-links a { font-size: 22px; color: var(--color-body-light); }
.footer .social-links a:hover { color: var(--color-light-green); }
.footer .copyright { margin-bottom: 5px; }
.footer .credits { color: var(--color-body-light); font-size: 13px; }
.scroll-top { position: fixed; bottom: 20px; right: 20px; width: 44px; height: 44px; background: var(--color-light-green); color: var(--color-contrast-dark); border-radius: 50%; display: grid; place-content: center; font-size: 24px; opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 996; }
.scroll-top.active { opacity: 1; visibility: visible; }
.scroll-top:hover { background-color: color-mix(in srgb, var(--color-light-green), black 10%); }
@media (min-width: 768px) {
  .hero .container { flex-direction: row; text-align: left; }
  .hero-content { flex: 1; }
  .hero-visual { flex: 1; }
  .hero-cta-hub { justify-content: flex-start; }
  #impact-dashboard .container { grid-template-columns: repeat(4, 1fr); }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .insights-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .service-grid { grid-template-columns: repeat(4, 1fr); }
  .insights-grid { grid-template-columns: repeat(3, 1fr); }
}