@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&family=Roboto:wght@300;400;700&display=swap');

:root {
  --primary-color: #0d1b2a;
  --secondary-color: #3a86ff;
  --background-color: #1b263b; /* Main darker background */
  --surface-color: #2a394f;   /* Lighter surface for components and sections */
  --text-color: #e0e1dd;
  --light-text-color: #ffffff;
  --header-height: 4.5rem;
}

/* --- Base Styles --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Roboto', sans-serif;
  line-height: 1.6;
  background-color: var(--background-color);
  color: var(--text-color);
  overflow-x: hidden;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0 2rem;
}

.section-title {
  font-family: 'Montserrat', sans-serif;
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 5px;
  background: var(--secondary-color);
  border-radius: 5px;
}

/* --- Preloader --- */
#preloader {
  background: var(--primary-color);
  height: 100vh;
  width: 100%;
  position: fixed;
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
}
.loader {
    border: 8px solid var(--surface-color);
    border-top: 8px solid var(--secondary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Header & Navigation --- */
#header {
  background: transparent;
  padding: 1rem 0;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  transition: background 0.4s, box-shadow 0.4s;
}

#header.scrolled {
  background: rgba(13, 27, 42, 0.85);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: calc(var(--header-height) - 1.5rem);
}

.logo {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--light-text-color);
}

.nav-links { list-style: none; display: flex; }
.nav-links li { margin-left: 2.5rem; }
.nav-link { color: var(--light-text-color); text-decoration: none; font-weight: 700; position: relative; transition: color 0.3s ease; }
.nav-link::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px; background: var(--secondary-color); transition: width 0.3s ease; }
.nav-link:hover::after, .nav-link.active-link::after { width: 100%; }
.nav-link:hover, .nav-link.active-link { color: var(--secondary-color); }
.nav-toggle { display: none; font-size: 1.5rem; cursor: pointer; color: var(--light-text-color); }

/* --- Hero Section --- */
.hero {
  height: 100vh;
  background: linear-gradient(rgba(13, 27, 42, 0.7), rgba(13, 27, 42, 0.7)), url('https://images.unsplash.com/photo-1555066931-4365d1469c8b?q=80&w=2070&auto-format&fit=crop') center center/cover no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--light-text-color);
}

.hero-content h1 { font-family: 'Montserrat', sans-serif; font-size: 4rem; margin-bottom: 1rem; }
.hero-content p { font-size: 1.8rem; margin-bottom: 2.5rem; font-weight: 300; }
.typed-text { color: var(--secondary-color); font-weight: 700; }

.btn { display: inline-block; background: var(--secondary-color); color: var(--light-text-color); padding: 0.8rem 2.5rem; text-decoration: none; border-radius: 50px; font-weight: 700; transition: all 0.3s ease; border: 2px solid var(--secondary-color); }
.btn:hover { background: transparent; color: var(--secondary-color); transform: translateY(-3px); }

/* --- Section Background Pattern (Corrected) --- */
#about, #skills { background: var(--background-color); }
#projects, #contact { background: var(--surface-color); }

/* --- About Section (Corrected) --- */
.about-container { display: grid; grid-template-columns: 0.8fr 1.2fr; align-items: center; gap: 4rem; }
.about-image { width: 100%; max-width: 350px; justify-self: center; }
.about-image img { width: 100%; border-radius: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); }
.about-data h3 { font-family: 'Montserrat', sans-serif; font-size: 1.8rem; margin-bottom: 1rem; }
.about-description { margin-bottom: 2.5rem; font-size: 1.1rem; line-height: 1.7; }
.about-highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-bottom: 3rem; }
.highlight-card { background: var(--surface-color); text-align: center; padding: 1.5rem 1rem; border-radius: 10px; transition: transform 0.3s, box-shadow 0.3s; }
.highlight-card:hover { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); }
.highlight-card i { font-size: 1.5rem; color: var(--secondary-color); margin-bottom: 0.5rem; }
.highlight-card h4 { font-family: 'Montserrat', sans-serif; font-size: 1rem; margin-bottom: 0.25rem; }
.highlight-card p { font-weight: 300; }
.btn-secondary { background: transparent; color: var(--secondary-color); border: 2px solid var(--secondary-color); }
.btn-secondary:hover { background: var(--secondary-color); color: var(--light-text-color); }

/* --- Projects Section (Corrected) --- */
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.project-card { background: var(--background-color); border-radius: 10px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2); overflow: hidden; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.project-card:hover { transform: translateY(-10px); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3); }
.project-card img { width: 100%; height: 220px; object-fit: cover; display: block; }
.project-info { padding: 1.5rem; }
.project-info h3 { font-family: 'Montserrat', sans-serif; margin-bottom: 0.5rem; font-size: 1.4rem; }
.project-links { margin-top: 1rem; }
.project-links a { color: var(--secondary-color); text-decoration: none; margin-right: 1.5rem; font-weight: 700; transition: color 0.3s ease; }
.project-links a:hover { color: var(--light-text-color); }
.project-links a i { margin-right: 0.5rem; }

/* --- Skills Section (Corrected) --- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 2rem; text-align: center; }
.skill-item { background: var(--surface-color); padding: 2rem 1rem; border-radius: 10px; font-size: 1.1rem; font-weight: 700; transition: all 0.3s ease; display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.skill-item:hover { background: var(--secondary-color); color: var(--light-text-color); transform: scale(1.05); }
.skill-item i { font-size: 2.5rem; color: var(--secondary-color); transition: color 0.3s ease; }
.skill-item:hover i { color: var(--light-text-color); }

/* --- Contact Section (Corrected) --- */
.contact-form { max-width: 700px; margin: 0 auto; }
.form-group { margin-bottom: 1.5rem; }
.form-group input, .form-group textarea { width: 100%; padding: 1rem; border: 2px solid var(--background-color); border-radius: 10px; background: var(--background-color); color: var(--text-color); transition: border-color 0.3s ease; font-family: 'Roboto', sans-serif; font-size: 1rem; }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--secondary-color); }

/* --- Footer --- */
footer { background: var(--primary-color); color: var(--text-color); text-align: center; padding: 3rem 0; border-top: 1px solid var(--surface-color); }
.social-links { margin-bottom: 1rem; }
.social-links a { color: var(--light-text-color); font-size: 1.8rem; margin: 0 1rem; transition: color 0.3s ease, transform 0.3s ease; }
.social-links a:hover { color: var(--secondary-color); transform: translateY(-3px); }

/* --- Scroll-up Button --- */
.scroll-up { position: fixed; right: 2rem; bottom: -20%; background-color: var(--secondary-color); color: var(--light-text-color); padding: 0.8rem 1rem; border-radius: 50%; z-index: 100; transition: bottom 0.4s, transform 0.3s; font-size: 1.2rem; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.scroll-up:hover { transform: translateY(-4px); }
.scroll-up.show-scroll { bottom: 3rem; }

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .about-container { grid-template-columns: 1fr; gap: 2.5rem; }
    .about-image { max-width: 300px; }
    .about-data { text-align: center; }
}
@media (max-width: 768px) {
  .section { padding: 4rem 0 2rem; }
  .nav-toggle { display: block; z-index: 1100; }
  .nav-links { position: fixed; top: 0; right: -100%; width: 70%; max-width: 300px; height: 100vh; background-color: rgba(13, 27, 42, 0.95); flex-direction: column; align-items: center; justify-content: center; transition: right 0.4s ease-in-out; backdrop-filter: blur(10px); box-shadow: -5px 0 15px rgba(0,0,0,0.2); }
  .nav-links.show-menu { right: 0; }
  .nav-links li { margin: 2rem 0; }
  .hero-content h1 { font-size: 3rem; }
  .hero-content p { font-size: 1.3rem; }
}
@media (max-width: 576px) {
    .about-highlights { grid-template-columns: 1fr; }
    .hero-content h1 { font-size: 2.5rem; }
    .project-grid { grid-template-columns: 1fr; }}