/* ==========================================================================
   Benjamin Narh-Madey — personal site
   Layout: sticky top nav + hero + full-width scrolling bands.
   Palette: deep teal + slate on crisp white, with dark mode.
   ========================================================================== */

:root {
  --bg: #ffffff;
  --band: #f4f8f7;
  --card: #ffffff;
  --text: #14201e;
  --muted: #566864;
  --accent: #0f766e;
  --accent-hover: #0b5c55;
  --accent-soft: rgba(15, 118, 110, 0.10);
  --accent-line: rgba(15, 118, 110, 0.25);
  --border: #e4eae8;
  --ring: rgba(15, 118, 110, 0.18);
  --shadow: 0 1px 3px rgba(16, 33, 31, 0.06);
  --shadow-hover: 0 14px 34px rgba(16, 33, 31, 0.14);
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --maxw: 1080px;
  --nav-h: 66px;
}

html[data-theme="dark"] {
  --bg: #0d1413;
  --band: #121e1c;
  --card: #16211f;
  --text: #e9eeec;
  --muted: #9db0ab;
  --accent: #2dd4bf;
  --accent-hover: #5fe6d6;
  --accent-soft: rgba(45, 212, 191, 0.13);
  --accent-line: rgba(45, 212, 191, 0.30);
  --border: #24332f;
  --ring: rgba(45, 212, 191, 0.22);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-hover: 0 14px 34px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--sans); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 { font-family: var(--serif); color: var(--text); line-height: 1.15; }
img { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1.2rem, 4vw, 2.4rem); }

/* eyebrow label with index number */
.eyebrow {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
  margin: 0 0 .7rem; display: flex; align-items: center; gap: .6rem;
}
.eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--accent-line); max-width: 60px; }

/* ---------- Top nav ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .wrap { display: flex; align-items: center; height: 100%; gap: 1rem; }
.wordmark {
  font-family: var(--serif); font-weight: 700; font-size: 1.12rem; color: var(--text);
  letter-spacing: -.01em; white-space: nowrap;
}
.wordmark:hover { color: var(--accent); }
.topnav { margin-left: auto; display: flex; align-items: center; gap: .3rem; }
.topnav a {
  color: var(--muted); font-weight: 500; font-size: .92rem;
  padding: .45rem .7rem; border-radius: 7px;
}
.topnav a:hover { color: var(--text); background: var(--accent-soft); }
.topnav a.active { color: var(--accent); }
.topnav a.nav-cv {
  border: 1px solid var(--accent); color: var(--accent); margin-left: .4rem;
}
.topnav a.nav-cv:hover { background: var(--accent); color: #fff; }
.theme-btn {
  cursor: pointer; margin-left: .3rem; width: 38px; height: 38px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; transition: all .15s ease;
}
.theme-btn:hover { color: var(--accent); border-color: var(--accent); }
.theme-btn svg { width: 17px; height: 17px; }
.menu-btn { display: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(60% 80% at 85% 0%, var(--accent-soft), transparent 70%),
    radial-gradient(50% 60% at 0% 100%, var(--accent-soft), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero-tagline { font-size: clamp(1.02rem, 2.2vw, 1.18rem); color: var(--muted); max-width: 34ch; margin: 1rem 0 1.4rem; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); font-weight: 700; margin: 0; letter-spacing: -.02em; }
.hero-affil { color: var(--muted); font-size: .98rem; margin: .5rem 0 0; }
.hero-affil a { font-weight: 600; }

.hero-tags { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1.5rem; }
.hero-tags span {
  font-size: .76rem; font-weight: 600; letter-spacing: .01em;
  background: var(--accent-soft); color: var(--accent); padding: .3rem .7rem; border-radius: 999px;
}
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.btn {
  display: inline-flex; align-items: center; gap: .45rem; font-weight: 600; font-size: .92rem;
  padding: .6rem 1.1rem; border-radius: 9px; transition: all .15s ease; cursor: pointer;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); color: #fff; transform: translateY(-1px); }
.btn.ghost { border: 1px solid var(--border); color: var(--text); background: var(--card); }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn svg { width: 16px; height: 16px; }

.hero-socials { display: flex; gap: .35rem; margin-left: .3rem; }
.hero-socials a {
  width: 40px; height: 40px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--card); color: var(--muted); transition: all .15s ease;
}
.hero-socials a:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-2px); }
.hero-socials svg { width: 18px; height: 18px; }

/* Hero visual: avatar with offset accent frame */
.hero-visual { position: relative; justify-self: center; }
.hero-visual .frame {
  position: absolute; inset: 14px -14px -14px 14px; border-radius: 20px;
  border: 2px solid var(--accent); z-index: 0;
}
.hero-visual img {
  position: relative; z-index: 1; width: min(280px, 60vw); aspect-ratio: 1; object-fit: cover;
  border-radius: 20px; box-shadow: var(--shadow-hover);
}

/* ---------- Bands / sections ---------- */
.band { padding: clamp(3rem, 7vw, 5rem) 0; border-top: 1px solid var(--border); }
.band.alt { background: var(--band); }
.band h2 { font-size: clamp(1.7rem, 4vw, 2.2rem); margin: 0 0 1.2rem; }
.lead { color: var(--muted); font-size: 1.05rem; max-width: 60ch; margin: 0 0 2rem; }
.band p { margin: 0 0 1rem; }
.prose { max-width: 68ch; }
.prose h3 { font-size: 1.2rem; margin: 1.8rem 0 .5rem; }

/* Callout */
.callout {
  background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0; padding: 1.2rem 1.4rem; margin: 1.4rem 0; box-shadow: var(--shadow);
}
.callout p:last-child { margin-bottom: 0; }

/* Grid of cards */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.1rem; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.card h4 { font-size: 1.12rem; margin: 0 0 .4rem; }
.card .meta { font-family: var(--mono); font-size: .78rem; color: var(--muted); margin: 0 0 .7rem; }
.card p { font-size: .93rem; margin: 0 0 .9rem; }
.card-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.card-links a { font-size: .8rem; font-weight: 600; padding: .32rem .7rem; border-radius: 7px; background: var(--accent-soft); color: var(--accent); }
.card-links a:hover { background: var(--accent); color: #fff; }
.badge-lang {
  float: right; font-family: var(--mono); font-size: .68rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  padding: .18rem .5rem; border-radius: 5px;
}

/* Research area cards with number */
.area h4 { display: flex; align-items: baseline; gap: .6rem; }
.area .idx { font-family: var(--mono); font-size: .85rem; color: var(--accent); font-weight: 700; }

/* Publications */
.pub { padding: 1.2rem 0; border-bottom: 1px solid var(--border); }
.pub:first-of-type { border-top: 1px solid var(--border); }
.pub .pub-title { font-weight: 600; font-size: 1.02rem; }
.pub .pub-authors { font-size: .93rem; margin: .25rem 0; }
.pub .pub-authors .me { color: var(--accent); font-weight: 700; }
.pub .pub-venue { color: var(--muted); font-size: .9rem; font-style: italic; }
.pub .pub-links { margin-top: .35rem; }
.pub .pub-links a { font-size: .82rem; font-weight: 600; }

/* Two-column (education + teaching) */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3rem); }
.two-col h3 { font-size: 1.25rem; margin: 0 0 1.2rem; }

/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1.5rem 1.5rem; border-left: 2px solid var(--border); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -7px; top: .3rem; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent); border: 2px solid var(--bg);
}
.timeline .date { font-family: var(--mono); font-size: .78rem; font-weight: 600; color: var(--accent); letter-spacing: .02em; }
.timeline .tl-title { font-weight: 600; margin: .1rem 0; }
.timeline .tl-sub { font-size: .9rem; color: var(--muted); }

/* News */
.news { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.news-item { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.news-item .date { font-family: var(--mono); font-size: .76rem; font-weight: 700; color: var(--accent); }
.news-item .tl-title { font-weight: 600; margin: .2rem 0; }
.news-item .tl-sub { font-size: .88rem; color: var(--muted); }

/* Skills */
.skill-group { margin-bottom: 1.5rem; }
.skill-group h4 { margin: 0 0 .6rem; font-size: 1.02rem; }
.skill-pills { display: flex; flex-wrap: wrap; gap: .45rem; }
.skill-pills span {
  font-size: .82rem; font-weight: 500; background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: .35rem .75rem; border-radius: 8px;
}
.skill-pills span:hover { border-color: var(--accent); color: var(--accent); }

/* Quote + footer */
.quote { font-family: var(--serif); font-style: italic; color: var(--muted); font-size: 1.02rem; max-width: 60ch; margin: 2rem 0 0; }
.site-foot { border-top: 1px solid var(--border); padding: 2rem 0; color: var(--muted); font-size: .85rem; text-align: center; }

/* ---------- CV page ---------- */
.cv-back { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; margin-bottom: 1.4rem; }
.cv-page { max-width: 840px; margin: 0 auto; padding: 3rem clamp(1.2rem, 5vw, 3rem); }
.cv-page h1 { font-size: 2.1rem; margin: 0 0 .2rem; }
.cv-page .cv-contact { color: var(--muted); margin: 0 0 2rem; font-size: .95rem; }
.cv-page h2 { font-size: 1.35rem; margin: 2.1rem 0 .7rem; padding-bottom: .3rem; border-bottom: 2px solid var(--accent); }
.cv-page ul { padding-left: 1.1rem; }
.cv-page li { margin-bottom: .5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hero .wrap { grid-template-columns: 1fr; text-align: left; }
  .hero-visual { justify-self: start; margin-top: 1.5rem; }
  .hero-visual img { width: 200px; }
  .two-col { grid-template-columns: 1fr; }
  .menu-btn {
    display: inline-flex; align-items: center; justify-content: center; margin-left: auto;
    width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border);
    background: var(--card); color: var(--text); cursor: pointer;
  }
  .menu-btn svg { width: 20px; height: 20px; }
  .topnav {
    position: fixed; top: var(--nav-h); left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: .1rem; padding: .6rem 1rem;
    background: var(--bg); border-bottom: 1px solid var(--border);
    transform: translateY(-140%); transition: transform .25s ease; box-shadow: var(--shadow-hover);
  }
  .topnav.open { transform: translateY(0); }
  .topnav a { padding: .7rem .8rem; }
  .topnav a.nav-cv { margin-left: 0; text-align: center; }
  .theme-btn { position: fixed; top: 13px; right: 66px; }
}
