/* ================================================================
   Samuel Oyefusi — Academic Portfolio
   Font: System serif headings + system sans body (no Google Fonts)
   ================================================================ */

:root {
  --bg:       #f9f8f6;
  --bg2:      #ffffff;
  --border:   #e2ddd8;
  --text:     #1c1c1c;
  --text2:    #5a5a5a;
  --text3:    #999;
  --accent:   #2c4a7c;
  --accent-h: #1a3260;
  --nav-bg:   rgba(249,248,246,0.92);
  --radius:   8px;
  --shadow:   0 1px 6px rgba(0,0,0,0.07);
  --t:        0.2s ease;
}

[data-theme="dark"] {
  --bg:       #131416;
  --bg2:      #1c1e21;
  --border:   #2e3035;
  --text:     #e8e6e1;
  --text2:    #9a9690;
  --text3:    #5e5c58;
  --accent:   #7aa2d4;
  --accent-h: #99bceb;
  --nav-bg:   rgba(19,20,22,0.94);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  background: var(--bg);
  color: var(--text);
  transition: background var(--t), color var(--t);
}

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

/* ── Navbar ─────────────────────────────────────────────────── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 max(2rem, calc(50vw - 400px));
}
.nav-name {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px; font-weight: 700; color: var(--text);
  letter-spacing: -0.01em;
}
nav ul { display: flex; gap: 2px; list-style: none; }
nav ul a {
  font-size: 13.5px; color: var(--text2); font-weight: 500;
  padding: 5px 11px; border-radius: 5px;
  transition: background var(--t), color var(--t);
}
nav ul a:hover, nav ul a.active {
  background: var(--border); color: var(--accent); text-decoration: none;
}
#theme-toggle {
  background: none; border: 1px solid var(--border);
  border-radius: 5px; padding: 4px 9px;
  font-size: 14px; cursor: pointer; color: var(--text2);
  transition: border-color var(--t);
}
#theme-toggle:hover { border-color: var(--accent); }

/* ── Wrapper ────────────────────────────────────────────────── */
.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Hero ───────────────────────────────────────────────────── */
#hero {
  padding: 96px 0 48px;
  display: flex; gap: 44px; align-items: flex-start;
}
.hero-photo {
  width: 300px; height: 390px; border-radius: 12px;
  object-fit: cover;
  object-position: center 12%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.hero-initials {
  width: 300px; height: 360px; border-radius: 12px;
  background: var(--accent); color: #fff;
  font-family: Georgia, serif; font-size: 46px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 2px solid var(--border);
}
.hero-text h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2rem; font-weight: 700; line-height: 1.2;
  margin-bottom: 6px; color: var(--text);
  letter-spacing: -0.02em;
}
.hero-tagline {
  font-size: 14px; color: var(--text2); margin-bottom: 14px;
  font-style: italic; min-height: 22px;
}
.hero-tagline .cursor {
  display: inline-block; width: 1px; height: 0.9em;
  background: var(--accent); margin-left: 1px;
  vertical-align: middle; animation: blink 0.8s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
.hero-bio {
  font-size: 14.5px; color: var(--text2); line-height: 1.72;
  margin-bottom: 18px; max-width: 560px;
}
.hero-bio strong { color: var(--text); font-weight: 600; }
.hero-links {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.hero-links a {
  font-size: 13px; font-weight: 500;
  color: var(--text2);
  border-bottom: 1px solid var(--border);
  padding-bottom: 1px;
  text-decoration: none;
  transition: color var(--t), border-color var(--t);
}
.hero-links a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }

/* ── Section ────────────────────────────────────────────────── */
.section { padding: 56px 0 12px; }
.section-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.25rem; font-weight: 700;
  color: var(--text); margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.section-rule {
  border: none; border-top: 1px solid var(--border);
  margin: 6px 0 24px;
}

/* ── News ───────────────────────────────────────────────────── */
.news-list { display: flex; flex-direction: column; gap: 0; }
.news-item {
  display: flex; gap: 16px; align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-size: 12px; color: var(--text3);
  white-space: nowrap; min-width: 80px;
  font-variant-numeric: tabular-nums;
}
.news-text { color: var(--text2); line-height: 1.55; }
.news-text strong { color: var(--text); font-weight: 600; }
.news-text a { font-weight: 500; }

/* ── Research ───────────────────────────────────────────────── */
.research-item {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 24px; padding: 24px 0;
  border-bottom: 1px solid var(--border);
}
.research-item:last-child { border-bottom: none; }
.research-thumb {
  border-radius: 6px; overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: var(--text3);
  border: 1px solid var(--border);
}
.research-thumb img, .research-thumb video {
  width: 100%; height: 100%; object-fit: cover;
}
.research-content h3 {
  font-family: Georgia, serif;
  font-size: 14.5px; font-weight: 700;
  color: var(--text); margin-bottom: 3px; line-height: 1.4;
}
.research-venue {
  font-size: 12.5px; color: var(--text3);
  margin-bottom: 8px; font-style: italic;
}
.research-content p {
  font-size: 13.5px; color: var(--text2);
  line-height: 1.65; margin-bottom: 10px;
}
.research-links { display: flex; gap: 14px; margin-bottom: 8px; }
.research-links a { font-size: 13px; font-weight: 500; }

/* ── Tags ───────────────────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 3px;
  background: var(--border); color: var(--text2);
  letter-spacing: 0.01em;
}

/* ── Publications ───────────────────────────────────────────── */
.pub-item {
  display: flex; gap: 14px; padding: 14px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.pub-item:last-child { border-bottom: none; }
.pub-num { color: var(--text3); min-width: 26px; font-size: 12px; padding-top: 2px; }
.pub-title { font-weight: 600; color: var(--text); margin-bottom: 3px; line-height: 1.45; }
.pub-authors { font-size: 13px; color: var(--text2); margin-bottom: 2px; }
.pub-authors strong { color: var(--text); }
.pub-venue { font-size: 12.5px; color: var(--text3); font-style: italic; }
.pub-badge {
  display: inline; font-size: 10.5px; font-weight: 600;
  padding: 1px 6px; border-radius: 3px; margin-left: 5px;
  font-style: normal; vertical-align: middle;
}
.pub-badge.springer { background: #fef3c7; color: #92400e; }
.pub-badge.ieee     { background: #dbeafe; color: #1e3a8a; }
.pub-badge.review   { background: #f3f4f6; color: #6b7280; }
.pub-badge.pub      { background: #d1fae5; color: #065f46; }

/* ── Projects grid ──────────────────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.filter-btn {
  font-size: 12.5px; font-weight: 500; padding: 4px 12px;
  border: 1px solid var(--border); border-radius: 4px;
  background: transparent; cursor: pointer; color: var(--text2);
  transition: all var(--t);
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.projects-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
  gap: 16px;
}
.project-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: box-shadow var(--t), transform var(--t);
}
.project-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.project-card.hidden { display: none; }
.project-thumb {
  position: relative;
  aspect-ratio: 16/9; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.project-thumb img, .project-thumb video { width:100%;height:100%;object-fit:cover; }
.project-thumb .thumb-gif {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity var(--t);
  pointer-events: none;
}
.project-card:hover .thumb-gif { opacity: 1; }
.project-body { padding: 14px; }
.project-body h3 {
  font-family: Georgia, serif;
  font-size: 13.5px; font-weight: 700;
  color: var(--text); margin-bottom: 4px; line-height: 1.4;
}
.project-meta { font-size: 11.5px; color: var(--text3); margin-bottom: 7px; }
.project-body p { font-size: 13px; color: var(--text2); line-height: 1.6; margin-bottom: 10px; }
.project-footer { display: flex; justify-content: space-between; align-items: flex-end; }
.project-link { font-size: 12.5px; font-weight: 600; color: var(--accent); }

/* ── Experience ─────────────────────────────────────────────── */
.exp-item {
  display: flex; gap: 16px;
  padding: 18px 0; border-bottom: 1px solid var(--border);
}
.exp-item:last-child { border-bottom: none; }
.exp-logo {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.exp-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.exp-logo span { font-size: 20px; }
.exp-content { flex: 1; }
.exp-header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px; }
.exp-role { font-size: 14.5px; font-weight: 700; color: var(--text); font-family: Georgia, serif; }
.exp-date { font-size: 12.5px; color: var(--text3); }
.exp-org  { font-size: 13.5px; color: var(--accent); font-weight: 500; margin: 2px 0 6px; }
.exp-desc { font-size: 13.5px; color: var(--text2); line-height: 1.65; }
.exp-desc ul { padding-left: 1.2em; }
.exp-desc li { margin-bottom: 2px; }

/* ── Education ──────────────────────────────────────────────── */
.edu-item {
  display: flex; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.edu-item:last-child { border-bottom: none; }
.edu-logo {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.edu-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.edu-logo span { font-size: 20px; }
.edu-content { flex: 1; }
.edu-header { display: flex; justify-content: space-between; flex-wrap: wrap; }
.edu-degree { font-weight: 700; color: var(--text); font-family: Georgia, serif; font-size: 14.5px; }
.edu-date   { font-size: 12.5px; color: var(--text3); }
.edu-school { font-size: 13.5px; color: var(--accent); font-weight: 500; margin: 2px 0 3px; }
.edu-detail { font-size: 13px; color: var(--text2); }

/* ── Scroll reveal ──────────────────────────────────────────── */
.reveal { opacity:0; transform:translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity:1; transform:translateY(0); }

/* ── Back to top ────────────────────────────────────────────── */
#back-to-top {
  position: fixed; bottom: 24px; right: 24px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); color: #fff; border: none;
  font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
  box-shadow: 0 2px 10px rgba(44,74,124,0.3);
}
#back-to-top.visible { opacity:1; pointer-events:auto; }
#back-to-top:hover { transform: translateY(-2px); }

/* ── Footer ─────────────────────────────────────────────────── */
footer {
  text-align: center; padding: 32px 0 48px;
  font-size: 13px; color: var(--text3);
  border-top: 1px solid var(--border); margin-top: 48px;
}
footer a { color: var(--text3); }
footer a:hover { color: var(--accent); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  #hero { flex-direction: column; gap: 20px; }
  .hero-photo, .hero-initials { width: 100%; max-width: 260px; height: 320px; }
  .hero-text h1 { font-size: 1.5rem; }
  .research-item { grid-template-columns: 1fr; }
  nav ul { display: none; }
}