/* ==========================================
   Ifeanyi Mordi - Academic Profile
   Clean, responsive, accessible
   ========================================== */

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

:root {
  --color-text: #1a1a2e;
  --color-text-light: #4a4a5a;
  --color-text-muted: #6b6b7b;
  --color-link: #1e40af;
  --color-link-hover: #1e3a5f;
  --color-accent: #1e40af;
  --color-accent-light: #dbeafe;
  --color-bg: #ffffff;
  --color-bg-alt: #f8f9fa;
  --color-border: #e5e7eb;
  --color-border-light: #f0f0f0;
  --font-serif: 'Source Serif 4', Georgia, serif;
  --font-sans: 'Source Sans 3', -apple-system, BlinkMacSystemFont, sans-serif;
  --max-width: 900px;
  --nav-height: 56px;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,0.04);
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  color: var(--color-text);
  line-height: 1.65;
  background: var(--color-bg);
}

/* ---- Accessibility ---- */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-accent);
  color: #fff;
  padding: 8px 16px;
  font-size: 14px;
  z-index: 10000;
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ---- Navigation ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}

.site-nav .container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-height);
}

.nav-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 4px;
}

.nav-menu a {
  display: block;
  padding: 6px 12px;
  font-size: 14px;
  color: var(--color-text-light);
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.2s;
  font-weight: 400;
}

.nav-menu a:hover,
.nav-menu a:focus {
  color: var(--color-accent);
  background: var(--color-accent-light);
}

.nav-menu a.active {
  color: var(--color-accent);
  background: var(--color-accent-light);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.hamburger,
.hamburger::before,
.hamburger::after {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  border-radius: 1px;
  transition: all 0.3s;
}

.hamburger {
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  position: absolute;
  left: 0;
}

.hamburger::before { top: -7px; }
.hamburger::after { top: 7px; }

/* ---- Container ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---- Hero ---- */
.hero {
  padding: 56px 0 48px;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border-light);
}

.hero-inner {
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.hero-photo {
  flex-shrink: 0;
}

.photo-placeholder {
  width: 160px;
  height: 200px;
  background: var(--color-bg-alt);
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.photo-placeholder svg {
  opacity: 0.4;
}

.hero-content h1 {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-accent);
  margin-bottom: 2px;
}

.hero-affiliation {
  font-size: 15px;
  color: var(--color-text-muted);
  margin-bottom: 20px;
}

.hero-bio {
  font-size: 15px;
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: 20px;
  max-width: 640px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.tag {
  display: inline-block;
  padding: 4px 12px;
  font-size: 13px;
  color: var(--color-accent);
  background: var(--color-accent-light);
  border-radius: 100px;
  font-weight: 500;
}

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

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-link-hover);
}

.btn-secondary {
  background: var(--color-bg);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ---- Sections ---- */
.section {
  padding: 48px 0;
}

.section-alt {
  background: var(--color-bg-alt);
}

.section h2 {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-accent);
  display: inline-block;
}

.subsection-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  margin: 32px 0 16px;
}

/* ---- Research Cards ---- */
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.research-card {
  padding: 24px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.research-card h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.research-card p {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.65;
}

/* ---- Timeline ---- */
.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
}

.timeline-item {
  position: relative;
  margin-bottom: 28px;
}

.timeline-marker {
  position: absolute;
  left: -28px;
  top: 6px;
  width: 12px;
  height: 12px;
  background: var(--color-accent);
  border-radius: 50%;
  border: 2px solid var(--color-bg);
}

.timeline-content h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}

.timeline-org {
  font-size: 15px;
  color: var(--color-text-light);
  font-weight: 500;
}

.timeline-date {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.timeline-detail {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.6;
}

/* ---- Publications ---- */
.pub-list {
  list-style: none;
}

.pub-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.pub-item:last-child {
  border-bottom: none;
}

.pub-citation {
  font-size: 15px;
  line-height: 1.65;
  color: var(--color-text);
  margin-bottom: 8px;
}

.pub-citation em {
  font-style: italic;
}

.pub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
}

.pub-link:hover {
  text-decoration: underline;
}

.pub-link svg {
  flex-shrink: 0;
}

.award-badge {
  display: inline-block;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-accent);
  background: var(--color-accent-light);
  border-radius: 100px;
  margin-left: 8px;
  vertical-align: middle;
}

/* ---- Teaching ---- */
.institution-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text);
  margin-top: 24px;
  margin-bottom: 2px;
}

.institution-role {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.course-card {
  padding: 20px;
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.course-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.course-header h4 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
}

.course-semester {
  font-size: 12px;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.course-date {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.course-details {
  list-style: disc;
  padding-left: 20px;
}

.course-details li {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: 4px;
}

/* ---- Awards ---- */
.award-list {
  list-style: none;
}

.award-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border-light);
}

.award-item:last-child {
  border-bottom: none;
}

.award-item .award-badge {
  flex-shrink: 0;
  margin-left: 0;
  margin-top: 2px;
}

.award-money {
  background: #fef3c7;
  color: #92400e;
}

.award-content h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.award-org {
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ---- Service ---- */
.service-grid {
  display: grid;
  gap: 20px;
}

.service-item {
  padding: 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.service-item h4 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}

.service-org {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.service-item ul {
  list-style: disc;
  padding-left: 20px;
}

.service-item ul li {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: 4px;
}

/* ---- Experience ---- */
.experience-list {
  display: grid;
  gap: 24px;
}

.experience-item {
  padding: 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.experience-item h4 {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 2px;
}

.exp-org {
  font-size: 14px;
  color: var(--color-text-light);
}

.exp-date {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.experience-item ul {
  list-style: disc;
  padding-left: 20px;
}

.experience-item ul li {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: 4px;
}

/* ---- Development ---- */
.dev-grid {
  display: grid;
  gap: 20px;
}

.dev-item {
  padding: 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.dev-item h4 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 8px;
}

.dev-item ul {
  list-style: disc;
  padding-left: 20px;
}

.dev-item ul li,
.dev-detail {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.6;
  margin-bottom: 4px;
}

/* ---- Skills ---- */
.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.skill-category {
  padding: 20px;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.skill-category h4 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
}

.skill-category p {
  font-size: 14px;
  color: var(--color-text-light);
  line-height: 1.65;
}

/* ---- Portfolio Section ---- */
.portfolio-section {
  background: var(--color-accent);
  color: #fff;
}

.portfolio-section h2 {
  color: #fff;
  border-bottom-color: rgba(255,255,255,0.4);
}

.portfolio-intro {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 24px;
  opacity: 0.92;
  max-width: 600px;
}

.portfolio-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius);
  text-decoration: none;
  color: #fff;
  transition: all 0.2s;
}

.portfolio-card:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.35);
}

.portfolio-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.portfolio-info h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.portfolio-info p {
  font-size: 14px;
  opacity: 0.85;
  line-height: 1.5;
  margin-bottom: 10px;
}

.portfolio-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.95;
}

.portfolio-link svg {
  flex-shrink: 0;
}

/* ---- Contact ---- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 16px;
}

.contact-info p {
  font-size: 15px;
  color: var(--color-text-light);
  line-height: 1.7;
}

.contact-links p {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  margin-bottom: 10px;
}

.contact-links svg {
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.contact-links a {
  color: var(--color-accent);
  text-decoration: none;
}

.contact-links a:hover {
  text-decoration: underline;
}

.placeholder-note {
  font-size: 12px;
  color: #999;
  font-style: italic;
}

.references-note {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 16px;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--color-text);
  color: rgba(255,255,255,0.7);
  padding: 32px 0;
  text-align: center;
}

.site-footer p {
  font-size: 14px;
  margin-bottom: 8px;
}

.footer-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 13px;
}

.footer-links a:hover {
  color: #fff;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
  :root {
    --max-width: 100%;
  }

  .container {
    padding: 0 18px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-menu {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    flex-direction: column;
    padding: 8px 0;
  }

  .nav-menu.nav-menu-open {
    display: flex;
  }

  .nav-menu a {
    padding: 10px 24px;
    border-radius: 0;
  }

  .hero {
    padding: 36px 0 32px;
  }

  .hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 28px;
  }

  .hero-content h1 {
    font-size: 28px;
  }

  .hero-tags {
    justify-content: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .photo-placeholder {
    width: 140px;
    height: 175px;
  }

  .research-grid,
  .skills-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 36px 0;
  }

  .section h2 {
    font-size: 22px;
    margin-bottom: 20px;
  }

  .course-header {
    flex-direction: column;
    gap: 4px;
  }

  .portfolio-card {
    flex-direction: column;
  }

  .timeline {
    padding-left: 22px;
  }

  .timeline-marker {
    left: -22px;
    width: 10px;
    height: 10px;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 24px;
  }

  .hero-title {
    font-size: 15px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .award-item {
    flex-direction: column;
    gap: 8px;
  }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Focus styles ---- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ---- Selection ---- */
::selection {
  background: var(--color-accent-light);
  color: var(--color-text);
}
