/* =====================================================================
   Emmanuel Abba — Portfolio stylesheet
   ---------------------------------------------------------------------
   HOW TO EDIT
   - Colours live in the :root tokens below. Change --accent to re-theme.
   - Dark-mode colours are in [data-theme="dark"].
   - Fonts are loaded in each HTML <head> (Google Fonts).
   ===================================================================== */

/* ---------- 1. Design tokens (light mode = default) ---------- */
:root {
  --accent: #1f7a4d;          /* deep green — main accent colour */
  --accent-strong: #165c39;   /* hover / pressed state */
  --accent-soft: #e6f2ec;     /* tinted backgrounds (tags, highlights) */

  --bg: #fbfbf8;              /* page background */
  --surface: #ffffff;         /* cards */
  --text: #17201b;            /* main text */
  --muted: #5b6660;           /* secondary text */
  --line: #e3e6e1;            /* borders and dividers */

  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;

  --radius: 14px;
  --maxw: 1080px;             /* max content width */
  --nav-h: 64px;              /* sticky nav height (used for anchor offsets) */
  --shadow: 0 1px 2px rgba(20, 30, 25, .04), 0 8px 24px rgba(20, 30, 25, .06);
}

/* ---------- 2. Dark mode tokens (toggled via the moon/sun button) ---------- */
[data-theme="dark"] {
  --accent: #4cc38a;
  --accent-strong: #6fd6a3;
  --accent-soft: #15301f;

  --bg: #0f1412;
  --surface: #161d1a;
  --text: #e8ece9;
  --muted: #9aa69f;
  --line: #26302b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}

/* ---------- 3. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px); /* keeps anchors clear of the sticky nav */
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color .25s ease, color .25s ease;
}

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

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.4rem); }
h3 { font-size: 1.2rem; font-family: var(--font-body); font-weight: 700; letter-spacing: 0; }

p { margin: 0 0 1em; }

/* Visible keyboard focus everywhere */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

/* Screen-reader-only helper */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* "Skip to content" link for keyboard users */
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100;
  background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { top: 12px; color: #fff; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- 4. Sticky navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--nav-h);
}

.brand {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--accent); }

.nav-links {
  display: flex;
  gap: 4px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.nav-links a:hover { color: var(--text); }

/* Active link: current page (aria-current) or the section in view (.is-active, set by JS) */
.nav-links a[aria-current="page"],
.nav-links a.is-active {
  color: var(--accent);
  background: var(--accent-soft);
}

.theme-toggle {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* Phones: brand + toggle on row one, scrollable link row below */
@media (max-width: 820px) {
  .nav { flex-wrap: wrap; gap: 0 12px; padding-top: 10px; }
  .theme-toggle { margin-left: auto; }
  .nav-links {
    order: 3;
    width: 100%;
    margin: 0 -20px;
    padding: 8px 20px 10px;
    width: calc(100% + 40px);
    overflow-x: auto;
    scrollbar-width: none;
  }
  .nav-links::-webkit-scrollbar { display: none; }
}

/* ---------- 5. Sections & shared bits ---------- */
.section { padding: 88px 0; }
.section + .section { border-top: 1px solid var(--line); }

.page-head { padding: 72px 0 24px; }
.page-head p { color: var(--muted); max-width: 60ch; font-size: 1.1rem; }

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--accent);
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.lead { font-size: 1.2rem; color: var(--muted); max-width: 62ch; }

/* Buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: .97rem;
  text-decoration: none;
  transition: border-color .2s, background-color .2s, transform .2s;
}
.btn:hover { border-color: var(--accent); color: var(--text); transform: translateY(-1px); }
.btn svg { width: 17px; height: 17px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-primary:hover { color: #0f1412; }

/* Tags / chips */
.tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.tags li {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .82rem;
  font-weight: 600;
}

/* Generic card */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: var(--shadow);
}

/* Placeholder marker — anything you still need to fill in */
.placeholder {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: .9em;
  background: #fff4cc;
  color: #6b5200;
  padding: 1px 6px;
  border-radius: 4px;
}
[data-theme="dark"] .placeholder { background: #3a3110; color: #f2d97a; }

/* ---------- 6. Hero ---------- */
.hero { padding: 96px 0 88px; }

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

.hero h1 { margin-bottom: .2em; }
.hero h1 em { font-style: italic; color: var(--accent); }

.hero .tagline {
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  color: var(--muted);
  margin-bottom: 32px;
  max-width: 46ch;
}

.hero .location {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: .95rem; margin-bottom: 20px;
}
.hero .location svg { width: 16px; height: 16px; }

/* Photo slot. Replace the monogram <div> with an <img> when you have a photo. */
.avatar {
  width: 220px; height: 220px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 4.5rem;
  color: var(--accent);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.1;
}
.stat span { color: var(--muted); font-size: .92rem; }

@media (max-width: 760px) {
  .hero { padding: 56px 0 64px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .avatar { width: 120px; height: 120px; font-size: 2.6rem; order: -1; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}

/* ---------- 7. About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1.6fr; gap: 48px; }
.about-grid p { font-size: 1.12rem; }
.about-facts { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.about-facts li { display: flex; gap: 10px; color: var(--muted); }
.about-facts strong { color: var(--text); min-width: 110px; }
@media (max-width: 760px) { .about-grid { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- 8. Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.skill-group h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.skill-group h3 .dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent); flex: none;
}

/* ---------- 9. Experience timeline ---------- */
.timeline {
  position: relative;
  list-style: none;
  margin: 32px 0 0;
  padding: 0 0 0 28px;
}
.timeline::before {           /* the vertical line */
  content: "";
  position: absolute;
  left: 6px; top: 8px; bottom: 8px;
  width: 2px;
  background: var(--line);
}
.timeline > li { position: relative; margin-bottom: 22px; }
.timeline > li::before {      /* the dot on the line */
  content: "";
  position: absolute;
  left: -28px; top: 30px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
}

.job-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 4px;
}
.job-head h3 { margin: 0; }
.job-dates { color: var(--muted); font-size: .92rem; font-weight: 600; white-space: nowrap; }
.job-org { color: var(--muted); margin: 0 0 4px; font-size: .97rem; }
.job-project { font-weight: 600; margin: 10px 0 6px; }
.job ul { margin: 0; padding-left: 20px; }
.job ul li { margin-bottom: 4px; }
.job ul li::marker { color: var(--accent); }

/* Filter chips above the timeline */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.filters button {
  font: inherit; font-size: .9rem; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
[data-theme="dark"] .filters button[aria-pressed="true"] { color: #0f1412; }
.timeline > li[hidden] { display: none; }

/* ---------- 10. Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 32px;
}
.project { display: flex; flex-direction: column; }
.project .meta { color: var(--muted); font-size: .88rem; font-weight: 600; margin-bottom: 8px; }
.project p:not(.meta) { color: var(--muted); flex: 1; } /* description grows so links line up */
.project .tags { margin-bottom: 18px; }
.project .project-link {
  font-weight: 700; font-size: .95rem; text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.project .project-link:hover { text-decoration: underline; }

/* ---------- 11. Education / certifications ---------- */
.edu-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 16px; }
.edu-item { display: grid; grid-template-columns: 160px 1fr; gap: 16px; }
.edu-item .when { color: var(--muted); font-weight: 600; font-size: .92rem; padding-top: 2px; }
.edu-item h3 { margin-bottom: 2px; }
.edu-item p { margin: 0; color: var(--muted); }
@media (max-width: 600px) { .edu-item { grid-template-columns: 1fr; gap: 2px; } }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 24px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }

.lang-table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.lang-table th, .lang-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.lang-table th { color: var(--muted); font-weight: 600; font-size: .85rem; }

.pubs { padding-left: 20px; margin: 24px 0 0; }
.pubs li { margin-bottom: 14px; color: var(--muted); }
.pubs li strong { color: var(--text); font-weight: 600; }

/* ---------- 12. Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 32px;
}
.contact-card {
  display: flex; flex-direction: column; gap: 4px;
  text-decoration: none; color: var(--text);
  transition: border-color .2s, transform .2s;
}
a.contact-card:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.contact-card svg { width: 24px; height: 24px; color: var(--accent); margin-bottom: 10px; }
.contact-card .label { color: var(--muted); font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.contact-card .value { font-weight: 600; word-break: break-word; }

.cta-band {
  margin-top: 8px;
  padding: 48px;
  border-radius: calc(var(--radius) + 6px);
  background: var(--accent-soft);
}
.cta-band h2 { margin-bottom: .3em; }
@media (max-width: 600px) { .cta-band { padding: 28px 22px; } }

/* ---------- 13. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0 40px;
  color: var(--muted);
  font-size: .93rem;
}
.footer-inner {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; list-style: none; padding: 0; margin: 0; }
.footer-links a { color: var(--muted); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--accent); }

/* ---------- 14. Scroll reveal ----------
   Only active when JS has run (html.js), so content is always visible without JS. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .6s ease, transform .6s ease;
}
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition: none !important; }
}

/* ---------- 15. Print: clean, ink-friendly ---------- */
@media print {
  .site-header, .theme-toggle, .filters, .btn-row, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; }
}

/* ---------- 16. Blog: listing page ---------- */
.project-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }

.post-list { list-style: none; padding: 0; margin: 32px 0 0; display: grid; gap: 20px; }
.post-card .meta { color: var(--muted); font-size: .88rem; font-weight: 600; margin-bottom: 8px; }
.post-card .post-title { font-size: clamp(1.35rem, 2.6vw, 1.7rem); margin-bottom: .4em; }
.post-card .post-title a { color: var(--text); text-decoration: none; }
.post-card .post-title a:hover { color: var(--accent); }
/* make the whole card clickable via the title link */
.post-card { position: relative; transition: border-color .2s, transform .2s; }
.post-card .post-title a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.post-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-card > p:not(.meta) { color: var(--muted); max-width: 70ch; }
.post-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.read-time { color: var(--muted); font-size: .88rem; font-weight: 600; margin: 0; }

/* ---------- 17. Blog: single post ---------- */
.post-head { padding-top: 56px; padding-bottom: 40px; max-width: 760px; }
.post-head h1 { font-size: clamp(2rem, 5vw, 3rem); }
.post-head .tags { margin: 20px 0 12px; }
.back-link { display: block; width: fit-content; margin-bottom: 28px; font-weight: 600; text-decoration: none; font-size: .95rem; }
.back-link:hover { text-decoration: underline; }
.post-summary { font-size: 1.2rem; color: var(--muted); }

.post-facts {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 24px;
  margin: 28px 0 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.post-facts dt { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; }
.post-facts dd { margin: 2px 0 0; font-weight: 600; }
@media (max-width: 600px) { .post-facts { grid-template-columns: 1fr; } }

/* Readable article body — about 68 characters per line */
.prose { max-width: 68ch; padding-bottom: 32px; font-size: 1.1rem; }
.prose h2 { font-size: 1.6rem; margin-top: 1.8em; }
.prose h2:first-of-type { margin-top: 0; }
.prose ul { padding-left: 22px; margin: 0 0 1em; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--accent); }
.prose figure { margin: 2em 0; }
.prose figure img { border-radius: var(--radius); border: 1px solid var(--line); }
.prose figcaption { color: var(--muted); font-size: .9rem; margin-top: 8px; }
.post-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 2.5em; }

.post-pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  max-width: 760px; padding: 32px 0 72px; border-top: 1px solid var(--line);
}
.post-pager a {
  display: block; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.post-pager a:hover { border-color: var(--accent); }
.post-pager a span { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.post-pager .next { text-align: right; }
@media (max-width: 600px) { .post-pager { grid-template-columns: 1fr; } .post-pager .next { text-align: left; } }

/* ---------- 18. Hero portrait ----------
   Transparent cut-out photo. The soft fade at the bottom blends the
   straight crop into the page. Change width to resize it. */
.portrait {
  display: block;
  width: 340px;
  align-self: end;
  margin-bottom: -64px;              /* fade ends exactly on the stats divider line */
}
.portrait img {
  width: 100%;
  height: auto;
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
}
@media (max-width: 760px) {
  .portrait { width: 220px; order: -1; margin: 0 auto -8px; }
}

/* ---------- 19. Logo in the nav ----------
   Change the height to resize; the width follows. */
.brand { display: inline-flex; align-items: center; color: var(--text); }
.brand .logo { height: 34px; width: auto; display: block; }
.brand:hover { color: var(--text); opacity: .85; }
@media (max-width: 820px) { .brand .logo { height: 30px; } }
