/* ==========================================================================
   Kenechukwu Ogbuagu: personal CV site
   Black and white. Layout: live fluid background, profile card on the left,
   sections as see-through cards in two columns (one column on phones).
   Colours are tokens on :root; dark mode follows the OS unless the visitor
   picks a theme with the toggle (stored as data-theme on <html>).
   ========================================================================== */

:root {
  --bg: #ffffff;
  --card: rgba(255, 255, 255, 0.86);
  --glass: rgba(255, 255, 255, 0.66);
  --card-border: #d9d9d9;
  --surface: #ffffff;
  --text: #0a0a0a;
  --muted: #555555;
  --faint: #8a8a8a;
  --line: #e6e6e6;
  --accent: #0a0a0a;
  --accent-ink: #ffffff;
  --accent-soft: rgba(0, 0, 0, 0.05);
  --tag-alt: #0a0a0a;
  --tag-alt-soft: transparent;
  --avatar-bg: #f2f2f2;
  --shadow: none;

  /* GitHub-style system fonts: San Francisco on Apple devices, Segoe UI on Windows, Roboto/Noto on Android */
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --display: var(--sans);
  --radius: 12px;
  --gap: 20px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0a0a;
    --card: rgba(14, 14, 14, 0.86);
    --glass: rgba(14, 14, 14, 0.62);
    --card-border: #2b2b2b;
    --surface: #141414;
    --text: #ededed;
    --muted: #a1a1a1;
    --faint: #6e6e6e;
    --line: #262626;
    --accent: #ededed;
    --accent-ink: #0a0a0a;
    --accent-soft: rgba(255, 255, 255, 0.07);
    --tag-alt: #ededed;
    --tag-alt-soft: transparent;
    --avatar-bg: #161616;
    --shadow: none;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --card: rgba(14, 14, 14, 0.86);
  --glass: rgba(14, 14, 14, 0.62);
  --card-border: #2b2b2b;
  --surface: #141414;
  --text: #ededed;
  --muted: #a1a1a1;
  --faint: #6e6e6e;
  --line: #262626;
  --accent: #ededed;
  --accent-ink: #0a0a0a;
  --accent-soft: rgba(255, 255, 255, 0.07);
  --tag-alt: #ededed;
  --tag-alt-soft: transparent;
  --avatar-bg: #161616;
  --shadow: none;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
p { margin: 0; }
ul, ol, dl { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Background fluid (drawn by assets/js/fluid.js; its colours are set there) ---------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.fluid { position: absolute; top: 0; left: 0; max-width: none; }

/* ---------- Page layout ---------- */
.page {
  display: grid;
  gap: var(--gap);
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
}

.board { display: flex; flex-direction: column; gap: var(--gap); }

/* Phones: one column, cards in reading order. */
@media (max-width: 759px) {
  .col { display: contents; }
  #about { order: 1; }
  #publications { order: 2; }
  #experience { order: 3; }
  #education { order: 4; }
  #projects { order: 5; }
  #skills { order: 6; }
  #recognition { order: 7; }
}

/* Tablets and up: two columns of cards. */
@media (min-width: 760px) {
  :root { --gap: 34px; }
  .page { padding: 36px 32px; }
  .card {
    padding: 26px;
    background: var(--glass);
    -webkit-backdrop-filter: blur(5px) saturate(1.2);
    backdrop-filter: blur(5px) saturate(1.2);
  }
  .board {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .col { display: flex; flex-direction: column; gap: var(--gap); }
}

/* Wide screens: profile on the left. */
@media (min-width: 1180px) {
  :root { --gap: 44px; }
  .page {
    grid-template-columns: 350px minmax(0, 1fr);
    align-items: start;
    padding: 48px;
  }
}

/* ---------- Profile card ---------- */
.profile { display: flex; flex-direction: column; position: relative; }
.profile .theme-toggle { position: absolute; top: 16px; right: 16px; }

/* Pixel-art portrait: native 64x64 grid shown at 4 screen px per art pixel
   (3 on tablets), in a round frame like a GitHub profile. */
.avatar {
  width: min(256px, 100%);
  height: auto;
  aspect-ratio: 1;
  margin-bottom: 20px;
  border-radius: 50%;
  border: 1px solid var(--card-border);
  background: var(--avatar-bg);
  image-rendering: pixelated;
}

.role {
  margin-top: 4px;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.45;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.75rem, 1.4rem + 1vw, 2rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.disciplines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 16px;
}
.disciplines span {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 500;
}

.lead {
  margin-top: 14px;
  color: var(--muted);
  font-size: 1rem;
}

.profile-meta {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.profile-meta li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.profile-meta a { overflow-wrap: anywhere; }
.profile-meta svg {
  flex: none;
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.actions .btn { flex: 1; justify-content: center; min-height: 42px; }
.icon-btn.round { flex: none; width: 42px; height: 42px; border-radius: 50%; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, filter 0.15s, transform 0.15s;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { opacity: 0.88; }

.profile-foot {
  display: grid;
  gap: 6px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.75rem;
  line-height: 1.5;
}
.profile-foot a { color: inherit; }

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sun shows in dark mode (click for light), moon in light mode. */
.icon-sun { display: none !important; }
:root[data-theme="dark"] .icon-sun { display: block !important; }
:root[data-theme="dark"] .icon-moon { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-sun { display: block !important; }
  :root:not([data-theme="light"]) .icon-moon { display: none !important; }
}

/* Tablet: profile card spans the top, portrait beside the text. */
@media (min-width: 760px) and (max-width: 1179px) {
  .profile {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 32px;
    align-items: start;
  }
  .avatar { grid-row: 1 / span 7; grid-column: 1; width: 192px; margin: 0; }
  .profile > :not(.avatar):not(.theme-toggle) { grid-column: 2; }
  .profile > h1 { padding-right: 48px; }
  .profile-foot { grid-column: 1 / -1 !important; }
  .actions { max-width: 420px; }
}

/* ---------- Card content ---------- */
.card-title {
  margin-bottom: 16px;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.sub-title {
  margin: 26px 0 14px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.card-title + .sub-title { margin-top: 0; }

.prose { font-size: 0.98rem; }

/* Publications */
.pubs { display: grid; }
.pub { display: grid; gap: 5px; padding: 16px 0; border-top: 1px solid var(--line); }
.pub:first-child { padding-top: 0; border-top: 0; }
.pub:last-child { padding-bottom: 0; }
.pub-meta { display: flex; align-items: center; gap: 10px; }
.tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tag-alt { background: var(--tag-alt-soft); color: var(--tag-alt); box-shadow: inset 0 0 0 1px var(--card-border); }
.pub-year { color: var(--faint); font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.pub-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.3;
  text-wrap: balance;
}
.pub-authors, .pub-venue { color: var(--muted); font-size: 0.9rem; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-links { margin-top: 2px; font-size: 0.88rem; overflow-wrap: anywhere; }

/* Timelines (experience, education) */
.timeline {
  display: grid;
  gap: 22px;
  padding-left: 20px;
  border-left: 2px solid var(--line);
}
.entry { position: relative; }
.entry::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}
.entry-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 2px 12px;
}
.entry-role { font-size: 0.98rem; font-weight: 600; }
.entry-date {
  color: var(--faint);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.entry-org { color: var(--accent); font-size: 0.88rem; font-weight: 500; }
.entry-note { margin-top: 4px; color: var(--muted); font-size: 0.92rem; }

.bullets { display: grid; gap: 5px; margin-top: 8px; }
.bullets li {
  position: relative;
  padding-left: 16px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 0.72em;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* Projects */
.projects { display: grid; }
.project { padding: 14px 0; border-top: 1px solid var(--line); }
.project:first-child { padding-top: 0; border-top: 0; }
.project:last-child { padding-bottom: 0; }
.project-title { font-family: var(--display); font-size: 1.02rem; font-weight: 600; line-height: 1.3; }
.project p { margin-top: 4px; color: var(--muted); font-size: 0.9rem; }

/* Skills */
.skills { display: grid; gap: 16px; }
.skill-row { display: grid; gap: 7px; }
.skill-row dt { font-weight: 600; font-size: 0.9rem; }
.skill-row dd { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips li {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
}

/* Recognition */
.awards { display: grid; gap: 10px; }
.awards li {
  position: relative;
  padding-left: 24px;
  color: var(--muted);
  font-size: 0.92rem;
}
.awards li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.42em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--accent-soft);
}
.awards strong { color: var(--text); font-weight: 600; }
.award-year { color: var(--faint); font-variant-numeric: tabular-nums; margin-left: 4px; }

/* ---------- Simple page (404) ---------- */
.simple-page {
  min-height: 80vh;
  display: grid;
  place-content: center;
  gap: 16px;
  padding: 48px 16px;
  text-align: center;
}
.simple-page h1 { margin: 0; }
.simple-page p { color: var(--muted); }
.simple-page .btn { justify-self: center; }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Print: the page doubles as a printable CV ---------- */
@media print {
  @page { margin: 14mm 14mm 16mm; }

  :root, :root[data-theme="dark"] {
    --bg: #fff; --card: #fff; --surface: #fff; --text: #111; --muted: #333; --faint: #555;
    --line: #ccc; --accent: #0a5d66; --accent-soft: #fff; --shadow: none;
    --tag-alt: #333; --tag-alt-soft: #fff;
    color-scheme: light;
  }

  html { font-size: 12.5px; }
  body { font-size: 10pt; line-height: 1.45; background: #fff; color: #111; }
  .bg, .skip-link, .avatar, .theme-toggle, .actions, .profile-foot { display: none !important; }

  .page { display: block; max-width: none; padding: 0; }
  .card { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
  .profile { display: block; position: static; max-height: none; overflow: visible; margin-bottom: 8pt; }
  h1 { font-size: 22pt; margin: 4pt 0 6pt; }
  .disciplines span { padding: 0; background: none; font-size: 10pt; }
  .disciplines span:not(:last-child)::after { content: " \00b7"; }
  .lead { margin-top: 4pt; }
  .profile-meta { display: flex; flex-wrap: wrap; gap: 4pt 16pt; margin-top: 4pt; }
  .profile-meta a { color: inherit; text-decoration: none; }

  .board { display: flex; flex-direction: column; gap: 0; }
  .col { display: contents; }
  #about { order: 1; } #publications { order: 2; } #experience { order: 3; }
  #education { order: 4; } #projects { order: 5; } #skills { order: 6; } #recognition { order: 7; }
  .board .card { padding: 10pt 0 4pt; border-top: 1px solid #bbb; }
  .card-title { font-size: 13pt; margin-bottom: 6pt; }
  .sub-title { margin: 8pt 0 5pt; }


  .pub { padding: 6pt 0; break-inside: avoid; }
  .pub-title { font-size: 11pt; }
  .timeline { gap: 8pt; padding-left: 0; border-left: 0; }
  .entry::before { display: none; }
  .entry, .project { break-inside: avoid; }
  .skill-row { grid-template-columns: 140pt 1fr; gap: 8pt; }
  .chips li { padding: 0 6pt; font-size: 8.5pt; }

  a { color: inherit; text-decoration: none; }
}
