/* ==========================================================================
   Tertius Adjaoke — Portfolio
   Design system: "attention map" — a computer-vision motif (bounding boxes,
   saliency gradient, feature-grid texture) applied to an academic layout.
   ========================================================================== */

:root {
  /* -- Color: dark (default) -- */
  --bg: #0B0F1A;
  --bg-alt: #0F1526;
  --panel: #131A2C;
  --border: rgba(231, 234, 242, 0.10);
  --border-strong: rgba(231, 234, 242, 0.18);
  --text: #E7EAF2;
  --text-dim: #9AA3B8;
  --text-faint: #6B7387;

  --accent-cool: #34E4C0;   /* teal — "cold" end of a saliency map   */
  --accent-warm: #F2A65A;   /* amber — "hot" end of a saliency map   */
  --accent-cool-rgb: 52, 228, 192;
  --accent-warm-rgb: 242, 166, 90;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --max: 1180px;

  --shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
}

[data-theme="light"] {
  --bg: #F5F4F0;
  --bg-alt: #EDECE6;
  --panel: #FFFFFF;
  --border: rgba(15, 20, 30, 0.10);
  --border-strong: rgba(15, 20, 30, 0.18);
  --text: #14161D;
  --text-dim: #52586A;
  --text-faint: #868DA0;

  --accent-cool: #0FA98A;
  --accent-warm: #D9822B;
  --accent-cool-rgb: 15, 169, 138;
  --accent-warm-rgb: 217, 130, 43;

  --shadow: 0 20px 50px -25px rgba(20,22,29,0.25);
}

/* -------------------------------------------------------------------- */
/* Reset / base                                                          */
/* -------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; line-height: 1.1; }
p { margin: 0 0 1em; color: var(--text-dim); }
button { font: inherit; cursor: pointer; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--accent-cool); color: #06120F; padding: .75em 1.2em;
  border-radius: 0 0 var(--radius-sm) 0; font-family: var(--font-mono); font-size: .85rem;
}
.skip-link:focus { left: 0; }

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .02em;
  color: var(--accent-cool);
  margin: 0 0 .9em;
}

/* -------------------------------------------------------------------- */
/* Feature-map grid texture                                              */
/* -------------------------------------------------------------------- */
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black 20%, transparent 75%);
  opacity: .6;
  pointer-events: none;
}

/* -------------------------------------------------------------------- */
/* Nav                                                                    */
/* -------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav {
  max-width: var(--max); margin: 0 auto; padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__brand { display: flex; align-items: center; gap: 6px; }
.nav__mark { font-family: var(--font-mono); font-weight: 600; font-size: 1.05rem; letter-spacing: .04em; }
.nav__mark-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-warm); }

.nav__menu { display: flex; align-items: center; gap: 28px; }
.nav__menu a { font-size: .92rem; color: var(--text-dim); transition: color .2s; }
.nav__menu a:hover { color: var(--text); }
.nav__cta {
  color: var(--text) !important;
  border: 1px solid var(--border-strong);
  padding: 7px 16px; border-radius: 999px;
}
.nav__cta:hover { border-color: var(--accent-cool); }

.theme-toggle {
  background: transparent; border: 1px solid var(--border-strong); border-radius: 999px;
  width: 34px; height: 34px; display: grid; place-items: center; color: var(--text-dim);
}
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

.nav__toggle { display: none; background: none; border: none; padding: 6px; flex-direction: column; gap: 4px; }
.nav__toggle span { width: 22px; height: 2px; background: var(--text); display: block; }

/* -------------------------------------------------------------------- */
/* Hero                                                                   */
/* -------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; padding: 84px 24px 90px; }
.hero__inner {
  max-width: var(--max); margin: 0 auto; position: relative;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center;
}
.hero__name {
  font-size: clamp(2.6rem, 5.4vw, 4.6rem);
  letter-spacing: -.01em;
  margin-bottom: .18em;
}
.hero__role {
  font-family: var(--font-mono); font-size: 1rem; color: var(--text-dim);
  margin: 0 0 1.1em;
}
.hero__lede { max-width: 46ch; font-size: 1.05rem; }

.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 1.6em 0 2.4em; }
.btn {
  font-family: var(--font-body); font-weight: 600; font-size: .92rem;
  padding: 12px 22px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid transparent; transition: transform .18s ease, background .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary { background: var(--accent-cool); color: #06120F; }
.btn--primary:hover { background: color-mix(in srgb, var(--accent-cool) 88%, white 12%); }
.btn--ghost { border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { border-color: var(--accent-cool); }
.btn--text { color: var(--text-dim); padding: 12px 4px; }
.btn--text:hover { color: var(--accent-warm); transform: none; }

.hero__stats { display: flex; gap: 34px; margin: 0; padding-top: 1.6em; border-top: 1px solid var(--border); }
.hero__stats dt { font-family: var(--font-mono); font-size: .74rem; color: var(--text-faint); margin-bottom: 4px; }
.hero__stats dd { margin: 0; font-family: var(--font-display); font-size: 1.5rem; color: var(--text); }

/* -- Detection frame (signature element) -- */
.hero__figure { position: relative; }
.detect {
  position: relative; aspect-ratio: 4 / 4.8; border-radius: var(--radius);
  overflow: hidden; background: linear-gradient(160deg, var(--panel), var(--bg-alt));
  border: 1px solid var(--border-strong); box-shadow: var(--shadow);
}
.detect__img { width: 100%; height: 100%; object-fit: cover; }
.detect__fallback {
  display: none; position: absolute; inset: 0; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, rgba(var(--accent-cool-rgb),.18), transparent 60%),
              radial-gradient(circle at 80% 80%, rgba(var(--accent-warm-rgb),.16), transparent 55%);
}
.detect--fallback .detect__img { display: none; }
.detect--fallback .detect__fallback { display: flex; }
.detect__fallback span {
  font-family: var(--font-display); font-size: 5rem; color: var(--text-faint);
}

.detect__boxes { position: absolute; inset: 0; width: 100%; height: 100%; }
.box {
  fill: none; stroke: var(--accent-cool); stroke-width: 2;
  stroke-dasharray: 700; stroke-dashoffset: 700;
  animation: draw 1.1s ease forwards;
}
.box--b { stroke: var(--accent-warm); animation-delay: .25s; }
.box--c { stroke: var(--accent-cool); animation-delay: .5s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.tag {
  position: absolute; font-family: var(--font-mono); font-size: .68rem;
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(4px);
  border: 1px solid var(--border-strong);
  padding: 4px 9px 4px 7px; border-radius: 999px;
  display: flex; align-items: center; gap: 6px; color: var(--text);
  opacity: 0; transform: translateY(4px);
  animation: tagIn .5s ease forwards;
}
.tag__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-cool); }
.tag--a { top: 8%; left: 7%; animation-delay: 1.05s; }
.tag--b { top: 49%; left: 15%; animation-delay: 1.25s; }
.tag--b .tag__dot { background: var(--accent-warm); }
.tag--c { bottom: 6%; right: 3%; animation-delay: 1.45s; }
@keyframes tagIn { to { opacity: 1; transform: translateY(0); } }

.detect__caption {
  font-family: var(--font-mono); font-size: .74rem; color: var(--text-faint);
  margin: 14px 2px 0; text-align: right;
}
.detect__caption a { color: var(--accent-cool); }

/* -------------------------------------------------------------------- */
/* Sections                                                               */
/* -------------------------------------------------------------------- */
.section { padding: 96px 24px; }
.section--alt { background: var(--bg-alt); }
.section__inner { max-width: var(--max); margin: 0 auto; }
.section__head { max-width: 640px; margin-bottom: 52px; }
.section__head h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }

/* About */
.about__body { max-width: 720px; }
.about__lead { font-size: 1.15rem; color: var(--text); }
.about__langs { display: flex; gap: 22px; margin-top: 1.6em; font-family: var(--font-mono); font-size: .85rem; color: var(--text-dim); }

/* Skills */
.skills-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.skill-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 24px; transition: border-color .2s, transform .2s;
}
.skill-card:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.skill-card h3 { font-size: 1rem; font-family: var(--font-mono); font-weight: 600; margin-bottom: 14px; color: var(--accent-cool); }
.skill-card--highlight { border-color: rgba(var(--accent-warm-rgb), .4); }
.skill-card--highlight h3 { color: var(--accent-warm); }
.skill-card ul li { color: var(--text-dim); font-size: .92rem; padding: 5px 0; border-top: 1px solid var(--border); }
.skill-card ul li:first-child { border-top: none; }

/* Project cards */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; display: flex; flex-direction: column; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card__top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card__icon { font-size: 1.4rem; }
.card__tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.card__tags span {
  font-family: var(--font-mono); font-size: .68rem; color: var(--text-dim);
  border: 1px solid var(--border); padding: 3px 8px; border-radius: 999px;
}
.card h3 { font-size: 1.15rem; margin-bottom: 10px; }
.card p { font-size: .92rem; flex-grow: 1; }
.card__link { font-family: var(--font-mono); font-size: .82rem; color: var(--accent-cool); margin-top: 10px; }
.card__link:hover { color: var(--accent-warm); }

/* Publications */
.pubs { display: flex; flex-direction: column; gap: 0; }
.pub {
  display: grid; grid-template-columns: 90px 1fr; gap: 32px;
  padding: 32px 0; border-top: 1px solid var(--border);
}
.pubs .pub:last-child { border-bottom: 1px solid var(--border); }
.pub__year { font-family: var(--font-mono); color: var(--text-faint); font-size: .95rem; padding-top: 3px; }
.pub__kind {
  font-family: var(--font-mono); font-size: .7rem; color: var(--accent-warm);
  border: 1px solid rgba(var(--accent-warm-rgb),.35); padding: 3px 9px; border-radius: 999px;
  display: inline-block; margin-bottom: 12px;
}
.pub__body h3 { font-size: 1.2rem; margin-bottom: 8px; max-width: 62ch; }
.pub__venue { font-size: .88rem; color: var(--text-faint); margin-bottom: 12px; }
.pub__link { font-family: var(--font-mono); font-size: .82rem; color: var(--accent-cool); }
.pub__link:hover { color: var(--accent-warm); }

/* Timeline */
.timeline { display: flex; flex-direction: column; max-width: 640px; }
.timeline li {
  padding: 24px 0 24px 28px; border-left: 2px solid var(--border); position: relative;
}
.timeline li::before {
  content: ''; position: absolute; left: -7px; top: 30px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--bg); border: 2px solid var(--accent-cool);
}
.timeline__date { font-family: var(--font-mono); font-size: .78rem; color: var(--text-faint); }
.timeline h3 { font-size: 1.1rem; margin: 6px 0 4px; }
.timeline p { margin: 0; font-size: .92rem; }

/* Contact */
.section--contact .section__head { max-width: 620px; }
.contact__lede { margin-top: .6em; }
.contact__grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 48px; }
.field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-family: var(--font-mono); font-size: .78rem; color: var(--text-dim); }
.field input, .field textarea {
  background: var(--panel); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 12px 14px; color: var(--text); font-family: var(--font-body); font-size: .95rem; resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--accent-cool); }
.field__note { font-family: var(--font-mono); font-size: .8rem; color: var(--accent-cool); min-height: 1.4em; }
.contact__links { display: flex; flex-direction: column; gap: 16px; align-self: start; }
.contact__links a { font-size: .98rem; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.contact__links a:hover { color: var(--accent-cool); }
.contact__location { font-family: var(--font-mono); font-size: .82rem; color: var(--text-faint); margin-top: 8px; }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 30px 24px; }
.footer__inner {
  max-width: var(--max); margin: 0 auto; display: flex; justify-content: space-between;
  font-family: var(--font-mono); font-size: .78rem; color: var(--text-faint);
}

/* -------------------------------------------------------------------- */
/* Responsive                                                            */
/* -------------------------------------------------------------------- */
@media (max-width: 940px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__figure { max-width: 380px; margin: 0 auto; order: -1; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr 1fr; }
  .contact__grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .3s ease;
  }
  .nav__menu.is-open { max-height: 400px; }
  .nav__menu a, .nav__menu .theme-toggle { padding: 14px 24px; width: 100%; border-top: 1px solid var(--border); }
  .nav__menu a { display: block; }
  .nav__cta { border: none; margin: 0; }
  .theme-toggle { justify-content: flex-start; border: none; border-radius: 0; width: 100%; }

  .hero { padding: 48px 20px 60px; }
  .hero__actions { flex-direction: column; align-items: flex-start; }
  .hero__stats { flex-wrap: wrap; row-gap: 16px; }
  .section { padding: 64px 20px; }
  .skills-grid, .cards { grid-template-columns: 1fr; }
  .pub { grid-template-columns: 1fr; gap: 6px; }
}
