/* =====================================================
   GLOBAL VARIABLES & RESET
===================================================== */
:root {
  --bg: #0b0f1a;
  --card-bg: #161b2a;
  --accent: #38bdf8;
  --text-main: #f8fafc;
  --text-dim: #94a3b8;
  --transition: all 0.3s ease;
}

html, body {
  overflow-x: hidden;
  margin: 0;
  background-color: var(--bg);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Offsets scroll for fixed navbar */
}

* {
  box-sizing: border-box;
}

.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 24px;
}

/* =====================================================
   TYPOGRAPHY
===================================================== */
.text-gradient {
  background: linear-gradient(90deg, #38bdf8, #818cf8);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.badge {
  display: inline-block;
  background: var(--accent);
  color: #000;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 2rem;
  border-left: 4px solid var(--accent);
  padding-left: 15px;
  margin-bottom: 2rem;
}

/* =====================================================
   NAVBAR
===================================================== */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  padding: 1rem 0;
  background: rgba(11, 15, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Logo - Premium Round Style */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.logo img {
  height: 42px;
  width: auto;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  transition: var(--transition);
}

.logo img:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(56, 189, 248, 0.35);
}

/* Desktop Nav Links */
.nav-links {
  display: flex;
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav-item {
  position: relative;
  color: var(--text-dim);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.25s ease;
}

.nav-item::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), #818cf8);
  transform: translateX(-50%);
  transition: width 0.3s ease;
}

.nav-item:hover, .nav-item.active {
  color: var(--text-main);
}

.nav-item:hover::after, .nav-item.active::after {
  width: 100%;
}

.nav-link-btn {
  background: rgba(56,189,248,0.12);
  color: var(--accent);
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid rgba(56,189,248,0.3);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.nav-link-btn:hover {
  box-shadow: 0 10px 30px rgba(56, 189, 248, 0.35);
}

/* Mobile Toggle (Hidden on Desktop) */
.menu-toggle {
  display: none;
}

/* =====================================================
   HERO SECTION
===================================================== */
.hero {
  padding-top: 140px;
  padding-bottom: 80px;
  position: relative;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
}

.hero .desc {
  max-width: 640px;
  color: var(--text-dim);
  font-size: 1.1rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.hero .buttons {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn {
  padding: 14px 32px;
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  text-decoration: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
}

.btn.primary {
  background: linear-gradient(135deg, rgba(56,189,248,0.95), rgba(129,140,248,0.95));
  color: #0b0f1a;
  border: none;
  box-shadow: 0 10px 35px rgba(56,189,248,0.35);
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 45px rgba(56, 189, 248, 0.45);
}

.btn.secondary {
  background: rgba(22,27,42,0.55);
  color: var(--text-main);
  border: 1px solid rgba(148,163,184,0.35);
}

.btn.secondary:hover {
  background: rgba(255,255,255,0.05);
}

/* =====================================================
   SKILLS & EXPERIENCE
===================================================== */
.section {
  padding: 80px 0;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.skill-category {
  background: var(--card-bg);
  padding: 30px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  transition: var(--transition);
}

.skill-category:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.skill-category ul {
  list-style: none;
  padding: 0;
}

.skill-category li {
  margin-bottom: 12px;
  color: var(--text-dim);
  display: flex;
  align-items: center;
}

.skill-category li::before {
  content: "▹";
  color: var(--accent);
  margin-right: 12px;
  font-weight: bold;
}

/* Timeline */
.timeline-item {
  border-left: 2px solid #1e293b;
  padding-left: 20px;
  margin-bottom: 30px;
  position: relative;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-item h3 {
  margin: 0 0 5px 0;
  font-size: 1.25rem;
}

.timeline-item .company {
  color: var(--accent);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.timeline {
    position: relative;
    max-width: 800px;
    margin: 2rem 0;
}

/* The vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--accent), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    padding-left: 30px;
}

/* The dots on the line */
.timeline-item::after {
    content: '';
    position: absolute;
    left: -5px;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent);
}

.timeline-date {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
}

.timeline-item h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-main);
}

.timeline-item .company {
    color: var(--text-dim);
    font-weight: 600;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.timeline-desc {
    color: var(--text-dim);
    line-height: 1.6;
    font-size: 0.95rem;
}

.timeline-desc strong {
    color: var(--text-main);
}

/* =====================================================
   PROJECTS (Unified Premium Style)
===================================================== */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
}

.project-card {
  background: linear-gradient(180deg, rgba(22,27,42,0.95), rgba(15,20,35,0.98));
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
}

.project-image {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
}

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

.img-placeholder {
  width: 100%;
  height: 100%;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-weight: 600;
}

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

.tech-tag {
  font-size: 0.75rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  margin-bottom: 8px;
  display: block;
}

.project-content h3 {
  margin: 0 0 10px 0;
  font-size: 1.4rem;
}

.project-content p {
  color: var(--text-dim);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.project-links {
  display: flex;
  gap: 20px;
  margin-top: auto;
}

.project-links .link {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.link.primary { color: var(--accent); }
.link.muted { color: var(--text-dim); }
.link:hover { text-decoration: underline; }


/* =====================================================
   CONTACT & FORM
===================================================== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 600px;
  margin-top: 2rem;
}

.contact-form input, .contact-form textarea {
  background: #161b2a;
  border: 1px solid #1e293b;
  padding: 16px;
  border-radius: 8px;
  color: white;
  font-family: inherit;
  font-size: 1rem;
}

.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.15);
}
/* =====================================================
   CONTACT TEXT & DETAILS STYLING
===================================================== */
.contact-intro {
  max-width: 700px;
  font-size: 1.1rem;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.contact-sub {
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

.contact-details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 24px;
  border-radius: 12px;
  display: inline-block; /* Keeps box only as wide as content */
  margin-bottom: 2rem;
}

.contact-details p {
  margin: 8px 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.contact-details strong {
  color: var(--accent);
  font-weight: 600;
}

.contact-details a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-details a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Mobile Adjustment for Contact */
@media (max-width: 768px) {
  .contact-details {
    display: block; /* Full width on mobile */
    width: 100%;
  }
}

/* =====================================================
   POPOVER (Modal)
===================================================== */
/* Centering Logic */
.contact-popover {
  margin: auto;
  border: none;
  background: transparent;
  padding: 0;
  overflow: visible;
}

.contact-popover::backdrop {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
}

.modal-content {
  background: #161b2a;
  width: 90vw;
  max-width: 400px;
  padding: 2rem;
  border-radius: 16px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  color: white;
  animation: popIn 0.3s ease;
}

.modal-content h3 { margin-top: 0; }

.contact-options {
  display: grid;
  gap: 12px;
  margin-top: 1.5rem;
}

.option-card {
  display: block;
  padding: 14px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-main);
  border: 1px solid transparent;
  transition: var(--transition);
}

.option-card:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent);
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   RESPONSIVE (MOBILE)
===================================================== */
@media (max-width: 768px) {
  
  .container { padding: 0 20px; }

  /* Hamburger Icon */
  .menu-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    z-index: 2001; /* Above mobile nav */
  }

  .menu-toggle .bar {
    width: 28px;
    height: 3px;
    background-color: var(--text-main);
    border-radius: 2px;
    transition: 0.3s;
  }

  /* Mobile Nav Drawer */
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%; /* Hidden by default */
    width: 75%;
    height: 100vh;
    background: rgba(11, 15, 26, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    transition: right 0.4s ease;
    z-index: 2000;
    box-shadow: -5px 0 30px rgba(0,0,0,0.5);
  }

  .nav-links.active {
    right: 0; /* Slide in */
  }

  .nav-item {
    font-size: 1.3rem;
  }

  /* Hamburger Animation */
  .menu-toggle.active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
  .menu-toggle.active .bar:nth-child(2) { opacity: 0; }
  .menu-toggle.active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 2.5rem; }
  .btn { width: 100%; }
}