/* Sohaib Ahmed — Portfolio 2026 */

:root {
  --primary: #0f172a;
  --primary-soft: #1e293b;
  --accent: #2563eb;
  --accent-light: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --text: #0f172a;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e2e8f0;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h: 72px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Visible by default; animate only when JS is ready */
.no-js .reveal,
.reveal.visible {
  opacity: 1;
  transform: none;
}

html.js-ready .reveal:not(.visible) {
  opacity: 0;
  transform: translateY(20px);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-light); }

ul { list-style: none; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  z-index: 10000;
}
.skip-link:focus { top: 16px; }

/* Nav */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: background var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.navbar.scrolled {
  box-shadow: var(--shadow);
  border-bottom-color: var(--border);
}

.nav-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: 12px;
}

.nav-brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.nav-brand span { color: var(--accent); }

.nav-menu {
  display: flex;
  gap: 4px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  list-style: none;
}

.nav-link {
  display: inline-block;
  padding: 8px 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: 8px;
  transition: var(--transition);
  white-space: nowrap;
}
.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 28px;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: var(--transition);
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Hero */
.hero {
  position: relative;
  padding: calc(var(--nav-h) + 48px) 0 48px;
  overflow: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(37, 99, 235, 0.12), transparent),
    linear-gradient(180deg, var(--bg-alt) 0%, var(--bg) 100%);
  z-index: -1;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}

.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 16px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--primary);
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-lead {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 540px;
  margin-bottom: 32px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 10px;
  transition: var(--transition);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.btn-primary:hover {
  background: var(--accent-light);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
}

.btn-ghost {
  border: 1.5px solid var(--border);
  color: var(--primary);
  background: var(--bg);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-glow);
}

.profile-card {
  position: relative;
  max-width: 340px;
  margin: 0 auto;
}

.profile-img {
  width: 100%;
  max-height: 400px;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 15%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 4px solid var(--bg);
}

.profile-badge {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: var(--primary);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 64px;
  padding: 28px 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.stat-item { text-align: center; }

.stat-value {
  display: block;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  display: block;
}

/* Sections */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }

.section-header { margin-bottom: 48px; }

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Reveal animations (see html.js-ready rules above) */
.reveal {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

.about-card p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 1.05rem;
}
.about-card strong { color: var(--primary); }

.highlights-list { display: flex; flex-direction: column; gap: 20px; }

.highlights-list li {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}
.highlights-list li:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.highlight-icon {
  color: var(--accent);
  font-size: 0.65rem;
  margin-top: 6px;
}

.highlights-list strong {
  display: block;
  color: var(--primary);
  margin-bottom: 4px;
}
.highlights-list p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--border));
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding: 28px 0 28px 32px;
  border-bottom: 1px solid var(--border);
}
.timeline-item:last-child { border-bottom: none; }

.timeline-item::before {
  content: '';
  position: absolute;
  left: -22px;
  top: 36px;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 3px solid var(--bg-alt);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--accent);
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.timeline-meta time {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.timeline-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  background: #dcfce7;
  color: #166534;
  border-radius: 999px;
}

.timeline-item h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.timeline-org {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.timeline-item ul {
  list-style: disc;
  padding-left: 20px;
  color: var(--text-muted);
}
.timeline-item li { margin-bottom: 6px; }

/* Skills tabs */
.skills-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.skill-tab {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  transition: var(--transition);
}
.skill-tab:hover { border-color: var(--accent); color: var(--accent); }
.skill-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.skill-panel { display: none; animation: fadeIn 0.3s ease; }
.skill-panel.active { display: block; }

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

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tags span {
  padding: 10px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--primary);
  transition: var(--transition);
}
.skill-tags span:hover {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: translateY(-2px);
}

/* Projects */
.filter-chips {
  display: flex;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.chip {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  color: var(--text-muted);
  transition: var(--transition);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

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

.project-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.project-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}
.project-card.hidden { display: none; }

.project-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.project-top h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}

.install-badge {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: 6px;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.project-rating {
  font-weight: 700;
  color: #b45309;
}

.project-publisher {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary-soft);
  margin-bottom: 6px;
}

.project-role {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
}

.project-card .project-desc,
.project-card > p:not(.project-publisher):not(.project-role) {
  color: var(--text-muted);
  font-size: 0.95rem;
  flex: 1;
  margin-bottom: 16px;
  line-height: 1.6;
}

.project-tech {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.project-link {
  font-weight: 600;
  font-size: 0.9rem;
}

/* GitHub / Repos */
.github-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}

.github-stat {
  flex: 1;
  min-width: 140px;
  padding: 16px 20px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.github-stat strong {
  display: block;
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.github-stat span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.repo-card {
  padding: 22px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.repo-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: var(--text);
}

.repo-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.repo-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
  word-break: break-word;
}

.repo-lang {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
}

.repo-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  flex: 1;
  line-height: 1.55;
}

.github-cta {
  text-align: center;
  margin-top: 32px;
}

/* Education */
.education-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 28px 32px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.education-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
}
.edu-org { color: var(--text-muted); margin-top: 4px; }
.edu-gpa {
  font-weight: 700;
  color: var(--accent);
  padding: 8px 16px;
  background: var(--accent-glow);
  border-radius: 8px;
}

.languages-row {
  margin-top: 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 24px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
  text-align: left;
  color: inherit;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}
.contact-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  color: inherit;
}
.contact-copy { cursor: pointer; }
.contact-copy.copied {
  border-color: #22c55e;
  background: #f0fdf4;
}

.contact-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.contact-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.45;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.contact-social .contact-value {
  font-size: 0.9rem;
}

/* Footer */
.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.footer-note a { font-weight: 600; }

/* Back to top */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 100px;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  z-index: 999;
  transition: var(--transition);
  opacity: 0;
  pointer-events: none;
}
.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-4px);
}
.back-to-top svg { width: 20px; height: 20px; }

/* Responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero-lead { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .hero-visual { order: -1; }
  .profile-card { max-width: 260px; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .nav-link {
    padding: 8px 10px;
    font-size: 0.8125rem;
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #fff;
    padding: 12px 16px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.35s ease, opacity 0.25s ease, visibility 0.25s;
  }
  .nav-menu.active {
    max-height: 520px;
    opacity: 1;
    visibility: visible;
  }
  .nav-link {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
  }
  .section { padding: 64px 0; }
  .education-card { flex-direction: column; align-items: flex-start; }
  .hero { min-height: auto; padding-bottom: 32px; }
}

@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr; padding: 20px; }
  .hero-cta { flex-direction: column; }
  .btn { width: 100%; }
}

.nav-resume {
  color: var(--accent) !important;
  font-weight: 600;
}

.contact-resume {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.btn-sm {
  padding: 10px 18px;
  font-size: 0.875rem;
}

/* Resume viewer page */
.resume-page {
  min-height: 100vh;
  background: var(--bg-alt);
}

.resume-toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.resume-toolbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.resume-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.resume-main {
  padding: 32px 0 48px;
}

.resume-intro {
  margin-bottom: 20px;
}

.resume-intro h1 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--primary);
}

.resume-intro p {
  color: var(--text-muted);
  margin-top: 4px;
}

.resume-viewer {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.resume-viewer iframe {
  width: 100%;
  height: min(82vh, 900px);
  border: 0;
  display: block;
}

.resume-fallback {
  padding: 14px 20px;
  font-size: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  border-top: 1px solid var(--border);
  margin: 0;
}

@media (max-width: 480px) {
  .resume-viewer iframe { height: 70vh; }
  .resume-actions { width: 100%; }
  .resume-actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js-ready .reveal:not(.visible),
  .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
