/* ============================================
   ATTA ULLAH — ACADEMIC HOMEPAGE
   Clean, Content-First Academic Design
   ============================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,300;8..60,400;8..60,600;8..60,700&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  --bg: #ffffff;
  --bg-alt: #f8f9fa;
  --bg-hover: #f1f3f5;
  --border: #e5e7eb;
  --border-light: #f0f0f0;

  --text: #1a1a2e;
  --text-secondary: #4a4a68;
  --text-muted: #6b7280;
  --text-light: #9ca3af;

  --accent: #1a3c6e;
  --accent-light: #2563a0;
  --accent-bg: #eef3f9;
  --accent-border: #ccdaed;

  --highlight: #b45309;

  --font-serif: 'Source Serif 4', 'Georgia', serif;
  --font-sans: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --max-width: 820px;
  --nav-height: 60px;

  --radius: 4px;
  --transition: 200ms ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--accent-bg);
  color: var(--accent);
}

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

img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* ---------- Layout ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Fade-in (subtle) ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   NAVIGATION — minimal academic nav
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.nav-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.nav-name:hover {
  text-decoration: none;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1.75rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 1.5px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  text-decoration: none;
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  flex-direction: column;
  gap: 4px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  transition: all var(--transition);
}
.nav-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(4px, 4px); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(4px, -4px); }

/* ============================================
   HERO — Clean academic header
   ============================================ */
.hero {
  padding: 4rem 0 3rem;
  border-bottom: 1px solid var(--border);
}

.hero .container {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}

.hero-photo {
  width: 160px;
  height: 160px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.hero-info {
  flex: 1;
}

.hero-info h1 {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.hero-title {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-weight: 400;
}

.hero-affiliation {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.85rem;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--accent-light);
  font-weight: 500;
}
.hero-links a:hover {
  color: var(--accent);
}

.btn-cv {
  padding: 0.4rem 1rem;
  background: var(--accent);
  color: #ffffff !important;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.btn-cv:hover {
  background: var(--accent-light);
  text-decoration: none;
}

/* ============================================
   SECTIONS — Consistent academic layout
   ============================================ */
.section {
  padding: 3rem 0;
  border-bottom: 1px solid var(--border-light);
}
.section:last-of-type {
  border-bottom: none;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ============================================
   ABOUT
   ============================================ */
.about-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.9;
  margin-bottom: 1.5rem;
}

.research-interests {
  margin-top: 1.25rem;
}

.research-interests h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.interest-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.interest-item {
  font-size: 0.8rem;
  padding: 0.25rem 0.65rem;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 3px;
  font-weight: 500;
}

/* ============================================
   PUBLICATIONS — Academic list style
   ============================================ */
.pub-list {
  counter-reset: pub-counter;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.pub-entry {
  position: relative;
  padding-left: 2.5rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.pub-entry::before {
  counter-increment: pub-counter;
  content: "[" counter(pub-counter) "]";
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.pub-entry .pub-title {
  font-weight: 600;
  color: var(--text);
}

.pub-entry .pub-authors {
  color: var(--text-secondary);
}

.pub-entry .pub-self {
  font-weight: 600;
  color: var(--accent);
}

.pub-entry .pub-venue {
  font-style: italic;
  color: var(--highlight);
}

.pub-entry .pub-year {
  color: var(--text-muted);
}

.pub-entry .pub-doi {
  font-size: 0.8rem;
  color: var(--accent-light);
  font-family: var(--font-mono);
}
.pub-entry .pub-doi:hover {
  color: var(--accent);
}

.pub-section-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 2rem 0 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

/* ============================================
   EXPERIENCE — Clean list
   ============================================ */
.experience-list {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.exp-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.exp-date {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-top: 0.15rem;
  white-space: nowrap;
}

.exp-details h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.exp-details .exp-org {
  color: var(--accent-light);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.exp-details ul {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
}

.exp-details li {
  position: relative;
  padding-left: 1rem;
  margin-bottom: 0.3rem;
}
.exp-details li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--text-light);
}

/* ============================================
   EDUCATION
   ============================================ */
.education-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.edu-item {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.25rem;
  font-size: 0.9rem;
}

.edu-details h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.1rem;
}

.edu-details .edu-school {
  color: var(--accent-light);
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.edu-details .edu-info {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.7;
}

/* ============================================
   SKILLS — Compact grouped layout
   ============================================ */
.skills-group {
  margin-bottom: 1.25rem;
}

.skills-group h3 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 0.5rem;
}

.skills-group p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

.skills-group .skill-tag {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--bg-alt);
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
  border: 1px solid var(--border);
}

/* ============================================
   PROJECTS — Compact
   ============================================ */
.projects-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.proj-item {
  padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.proj-item h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
}

.proj-item p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
}

.proj-item .proj-tags {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.proj-item .proj-tag {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  padding: 0.15rem 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 2px;
  color: var(--text-muted);
}

/* ============================================
   AWARDS
   ============================================ */
.awards-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.award-item {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.award-bullet {
  color: var(--highlight);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.award-item strong {
  color: var(--text);
}

/* ============================================
   CONTACT
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.contact-details {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 2;
}

.contact-details a {
  color: var(--accent-light);
}

.contact-details .contact-label {
  font-weight: 600;
  color: var(--text);
  display: inline-block;
  min-width: 60px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: var(--text-light);
}
.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent-light);
}

.contact-form textarea {
  resize: vertical;
  min-height: 100px;
}

.btn-submit {
  align-self: flex-start;
  padding: 0.55rem 1.5rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition);
}
.btn-submit:hover {
  background: var(--accent-light);
}

/* ============================================
   REFERENCES
   ============================================ */
.references-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.ref-item {
  font-size: 0.9rem;
  line-height: 1.6;
}

.ref-item strong {
  color: var(--text);
  display: block;
}

.ref-item .ref-role {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.ref-item .ref-affil {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .hero .container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .hero-photo {
    width: 130px;
    height: 130px;
  }
  .hero-links {
    justify-content: center;
  }
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 240px;
    height: 100vh;
    flex-direction: column;
    background: var(--bg);
    padding: calc(var(--nav-height) + 1.5rem) 1.5rem 1.5rem;
    gap: 1rem;
    transition: right var(--transition);
    box-shadow: -4px 0 12px rgba(0,0,0,0.08);
    z-index: 999;
  }
  .nav-links.open { right: 0; }
  .nav-toggle { display: flex; }

  .exp-item, .edu-item {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-info h1 { font-size: 1.5rem; }
  .container { padding: 0 1rem; }
  .section { padding: 2rem 0; }
}
