/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0a0e1a;
  --bg-card:   #111827;
  --bg-card2:  #1a2235;
  --border:    #1e2d45;
  --accent:    #4f9cf9;
  --accent2:   #6ee7f7;
  --text:      #e2e8f0;
  --text-muted:#8899aa;
  --green:     #4ade80;
  --yellow:    #facc15;
  --red:       #f87171;
  --radius:    12px;
  --shadow:    0 4px 24px rgba(0,0,0,.45);
  --font:      'Inter', sans-serif;
  --mono:      'JetBrains Mono', monospace;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── NAV ── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(14px);
  background: rgba(10,14,26,.8);
  border-bottom: 1px solid var(--border);
  transition: box-shadow .3s;
}
#navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,.5); }

.nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
  font-family: var(--mono);
  font-size: 1.25rem; font-weight: 700;
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.nav-links {
  display: flex; align-items: center; gap: 28px;
}
.nav-links a {
  font-size: .9rem; font-weight: 500; color: var(--text-muted);
  transition: color .2s;
}
.nav-links a:hover { color: var(--text); }
.btn-nav {
  padding: 8px 20px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  color: var(--accent) !important;
  font-size: .88rem !important;
  transition: background .2s, color .2s !important;
}
.btn-nav:hover { background: var(--accent); color: var(--bg) !important; }

.hamburger {
  display: none;
  flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px;
}
.hamburger span {
  display: block; width: 24px; height: 2px;
  background: var(--text-muted); border-radius: 2px;
  transition: .3s;
}

/* ── HERO ── */
#hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 100px 24px 60px;
  max-width: 1100px; margin: 0 auto;
  gap: 48px;
}
.hero-content { flex: 1; }
.hero-greeting {
  font-family: var(--mono); font-size: .95rem;
  color: var(--accent); letter-spacing: .1em;
  margin-bottom: 8px;
}
.hero-name {
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700; line-height: 1.1;
  background: linear-gradient(135deg, #fff 40%, var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}
.hero-title {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  color: var(--accent); font-weight: 500; margin-bottom: 20px;
}
.hero-sub {
  color: var(--text-muted); font-size: .98rem; max-width: 520px;
  margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.btn-primary {
  padding: 13px 28px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: var(--bg); font-weight: 600; border-radius: 8px;
  transition: opacity .2s, transform .2s;
}
.btn-primary:hover { opacity: .88; transform: translateY(-1px); }
.btn-secondary {
  padding: 13px 28px;
  border: 1px solid var(--border); border-radius: 8px;
  font-weight: 500;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  transition: border-color .2s;
}
.btn-secondary:hover { border-color: var(--accent); }
.hero-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
  padding: 6px 14px; border-radius: 20px;
  background: var(--bg-card); border: 1px solid var(--border);
  font-size: .8rem; color: var(--text-muted);
}

/* Terminal card */
.hero-visual { flex: 1; display: flex; justify-content: center; }
.terminal-card {
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: .82rem;
  width: 100%; max-width: 420px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.terminal-bar {
  background: #161b22;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot.red    { background: var(--red); }
.dot.yellow { background: var(--yellow); }
.dot.green  { background: var(--green); }
.terminal-title { margin-left: 8px; color: var(--text-muted); font-size: .78rem; }
.terminal-body { padding: 20px; line-height: 1.8; }
.terminal-body p { white-space: pre; }
.prompt { color: var(--green); margin-right: 8px; }
.output { color: #a8d8ff; padding-left: 16px; }
.cursor { display: inline-block; animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ── CONTAINER ── */
.container {
  max-width: 1100px; margin: 0 auto; padding: 0 24px;
}

/* ── SECTION COMMON ── */
section {
  padding: 100px 0;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700; text-align: center;
  margin-bottom: 60px;
  position: relative;
}
.section-title::after {
  content: '';
  display: block; width: 60px; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 2px; margin: 12px auto 0;
}

/* ── ABOUT ── */
#about { background: var(--bg-card); }
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 60px; align-items: start;
}
.about-text p {
  color: var(--text-muted); margin-bottom: 16px; font-size: .97rem;
}
.about-text p strong { color: var(--text); }
.about-links { display: flex; flex-direction: column; gap: 10px; margin-top: 28px; }
.about-link {
  display: flex; align-items: center; gap: 10px;
  color: var(--text-muted); font-size: .9rem;
  transition: color .2s;
}
.about-link:hover { color: var(--accent); }
.about-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.stat-card {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 20px;
  text-align: center;
  transition: border-color .2s, transform .2s;
}
.stat-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.stat-num {
  display: block; font-size: 2.2rem; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.stat-label { font-size: .82rem; color: var(--text-muted); margin-top: 6px; }

/* ── EXPERIENCE / TIMELINE ── */
#experience { background: var(--bg); }
.timeline { position: relative; max-width: 800px; margin: 0 auto; }
.timeline::before {
  content: '';
  position: absolute; left: 18px; top: 0; bottom: 0;
  width: 2px; background: var(--border);
}
.timeline-item {
  position: relative; padding-left: 58px; margin-bottom: 40px;
}
.timeline-dot {
  position: absolute; left: 10px; top: 24px;
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border: 3px solid var(--bg);
  z-index: 1;
}
.timeline-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
  transition: border-color .2s, transform .2s;
}
.timeline-card:hover { border-color: var(--accent); transform: translateX(4px); }
.timeline-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.job-title { font-size: 1.05rem; font-weight: 600; color: var(--text); }
.part-time { font-size: .85rem; font-weight: 400; color: var(--text-muted); }
.job-company { color: var(--accent); font-size: .9rem; margin-top: 4px; }
.timeline-meta { text-align: right; }
.job-date { display: block; font-size: .82rem; color: var(--text-muted); }
.job-location { display: block; font-size: .8rem; color: var(--text-muted); margin-top: 2px; }
.job-bullets {
  list-style: disc; padding-left: 18px; color: var(--text-muted);
  font-size: .92rem; margin-bottom: 16px; display: flex; flex-direction: column; gap: 6px;
}
.job-bullets li::marker { color: var(--accent); }
.job-tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  padding: 4px 12px; border-radius: 20px;
  background: rgba(79,156,249,.12); border: 1px solid rgba(79,156,249,.25);
  color: var(--accent); font-size: .77rem;
}

/* ── PROJECTS ── */
#projects { background: var(--bg-card); }
.projects-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.project-card {
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 32px;
  transition: border-color .2s, transform .2s;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow); }
.project-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.project-icon { font-size: 2rem; display: flex; align-items: center; justify-content: center; }

.project-icon.kfupm-logo {
  width: 52px; height: 52px; border-radius: 10px;
  overflow: hidden; flex-shrink: 0;
  background: #fff; padding: 4px;
}
.project-icon.kfupm-logo img {
  width: 100%; height: 100%; object-fit: contain;
}

.project-icon.lock-icon {
  color: var(--accent);
  width: 52px; height: 52px; flex-shrink: 0;
}
.project-year {
  font-family: var(--mono); font-size: .78rem;
  color: var(--text-muted); background: var(--bg-card);
  padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border);
}
.project-name { font-size: 1.1rem; font-weight: 600; margin-bottom: 4px; }
.project-location { font-size: .82rem; color: var(--accent); margin-bottom: 16px; }
.project-bullets {
  list-style: disc; padding-left: 18px;
  color: var(--text-muted); font-size: .9rem;
  margin-bottom: 20px; display: flex; flex-direction: column; gap: 6px;
}
.project-bullets li::marker { color: var(--accent); }
.project-tags { display: flex; gap: 8px; flex-wrap: wrap; }

.project-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 16px; padding: 8px 18px;
  border: 1px solid var(--accent); border-radius: 6px;
  color: var(--accent); font-size: .85rem; font-weight: 500;
  transition: background .2s, color .2s;
}
.project-link:hover { background: var(--accent); color: var(--bg); }

/* ── SKILLS ── */
#skills { background: var(--bg); }
.skills-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.skills-group {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px;
}
.skills-group-title {
  font-size: .95rem; font-weight: 600; margin-bottom: 18px;
  display: flex; align-items: center; gap: 10px;
}
.skills-icon { font-size: 1.1rem; }
.skills-list { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-pill {
  padding: 7px 16px; border-radius: 20px;
  background: var(--bg-card2); border: 1px solid var(--border);
  color: var(--text-muted); font-size: .83rem;
  transition: border-color .2s, color .2s;
}
.skill-pill:hover { border-color: var(--accent); color: var(--text); }
.skill-pill.highlight {
  background: rgba(79,156,249,.1); border-color: rgba(79,156,249,.3);
  color: var(--accent2);
}

/* ── EDUCATION ── */
#education { background: var(--bg-card); }
.edu-certs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.edu-subtitle {
  font-size: 1rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 20px;
}
.edu-card {
  display: flex; gap: 20px;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
}
.edu-icon { font-size: 2rem; flex-shrink: 0; margin-top: 4px; }
.edu-info h4 { font-size: 1rem; font-weight: 600; margin-bottom: 6px; }
.edu-school { color: var(--accent); font-size: .88rem; margin-bottom: 4px; }
.edu-date { font-size: .82rem; color: var(--text-muted); margin-bottom: 10px; }
.edu-coursework { font-size: .82rem; color: var(--text-muted); }

.certs-block { display: flex; flex-direction: column; gap: 16px; }
.cert-card {
  display: flex; gap: 16px; align-items: center;
  background: var(--bg-card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 20px;
  transition: border-color .2s;
}
.cert-card:hover { border-color: var(--accent); }
.cert-badge {
  width: 48px; height: 48px; flex-shrink: 0;
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  font-family: var(--mono); font-size: .75rem; font-weight: 700; color: var(--bg);
}
.cert-badge.in-progress { background: linear-gradient(135deg, #f59e0b, #f97316); }
.cert-badge.fin { background: linear-gradient(135deg, #4ade80, #22d3ee); }
.cert-info h4 { font-size: .92rem; font-weight: 600; margin-bottom: 4px; }
.cert-info p { font-size: .8rem; color: var(--text-muted); }
.in-progress-label {
  display: inline-block;
  padding: 2px 8px; border-radius: 10px;
  background: rgba(245,158,11,.15); border: 1px solid rgba(245,158,11,.35);
  color: #f59e0b; font-size: .72rem; font-weight: 500;
  vertical-align: middle; margin-left: 6px;
}

/* ── CONTACT ── */
#contact { background: var(--bg); }
.contact-sub {
  text-align: center; color: var(--text-muted); max-width: 480px;
  margin: -36px auto 48px;
}
.contact-cards {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px;
  max-width: 1100px; margin: 0 auto;
}
.contact-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 20px; text-align: center;
  transition: border-color .2s, transform .2s;
}
.contact-card:hover { border-color: var(--accent); transform: translateY(-4px); }
.contact-card.location { cursor: default; }
.contact-card-icon { color: var(--accent); }
.contact-card-label { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }
.contact-card-value { font-size: .85rem; color: var(--text); word-break: break-all; }

/* ── FOOTER ── */
footer {
  background: var(--bg-card); border-top: 1px solid var(--border);
  text-align: center; padding: 28px 24px;
  color: var(--text-muted); font-size: .85rem;
}
footer strong { color: var(--accent); }

/* ── ANIMATIONS ── */
.fade-in {
  opacity: 0; transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.fade-in.visible { opacity: 1; transform: none; }

/* ── MOBILE NAV OPEN ── */
.nav-links.open {
  display: flex; flex-direction: column;
  position: fixed; inset: 64px 0 0 0;
  background: var(--bg-card); padding: 32px 24px;
  gap: 24px; z-index: 99;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .nav-links:not(.open) { display: none; }
  .hamburger { display: flex; }

  #hero {
    flex-direction: column; text-align: center;
    padding-top: 90px;
  }
  .hero-badges { justify-content: center; }
  .hero-actions { justify-content: center; }
  .hero-sub { margin-left: auto; margin-right: auto; }

  .about-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr; }
  .edu-certs-grid { grid-template-columns: 1fr; }
  .contact-cards { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 500px) {
  .contact-cards { grid-template-columns: 1fr; }
  .about-stats { grid-template-columns: 1fr 1fr; }
  .timeline::before { display: none; }
  .timeline-item { padding-left: 0; }
  .timeline-dot { display: none; }
  .timeline-header { flex-direction: column; }
  .timeline-meta { text-align: left; }
}
