/* ============================================================
   Joy Abiola, ACA — portfolio
   Tokens first; both themes share one system.
   ============================================================ */

:root {
  --bg: #fcfcfd;
  --surface: #f4f4f5;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --ink: #18181b;
  --ink-2: #52525b;
  --ink-3: #71717a;
  --accent: #1e5c46;
  --on-accent: #ffffff;
  --accent-soft: #eaf2ee;
  --band: #f6f7f6;
  --wash: rgba(30, 92, 70, 0.035);

  --font-display: "Archivo", sans-serif;
  --font-body: "Spectral", serif;

  --text-xs: 0.6875rem;   /* 11px — labels, eyebrows */
  --text-sm: 0.875rem;    /* 14px — nav, buttons, meta */
  --text-md: 1.0625rem;   /* 17px — body */
  --text-lg: 1.5rem;      /* 24px — section titles, stats */
  --text-xl: clamp(2.25rem, 5vw, 3.25rem); /* hero */

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6.5rem;

  --max-w: 70rem;
  --radius: 3px;
}

[data-theme="dark"] {
  --bg: #101418;
  --surface: #161b20;
  --border: #262b31;
  --border-strong: #343b42;
  --ink: #f4f4f2;
  --ink-2: #a1a1aa;
  --ink-3: #7c7c85;
  --accent: #8fbfa8;
  --on-accent: #0c1511;
  --accent-soft: #1a2420;
  --band: #141a18;
  --wash: rgba(143, 191, 168, 0.04);
}

/* ---------- base ---------- */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-md);
  font-weight: 300;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 200ms ease, color 200ms ease;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
}

a { color: inherit; }

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

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

/* Ledger rules — a single hairline opens each section, with a short
   accent tick marking its start; hairlines carry rows of figures. */
.rule-total {
  border-top: 1px solid var(--border);
  position: relative;
}
.rule-total::after {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 2.5rem;
  border-top: 2px solid var(--accent);
}

.eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.num { font-variant-numeric: tabular-nums; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: 4rem;
}

.wordmark {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  margin-right: auto;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.site-nav a {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-2);
  transition: color 150ms ease;
}

.site-nav a:hover { color: var(--ink); }

.site-nav a[aria-current="page"] { color: var(--ink); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color 150ms ease, color 150ms ease;
}

.theme-toggle:hover { border-color: var(--border-strong); color: var(--ink); }

.theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
  transition: opacity 150ms ease, transform 150ms ease;
}

.btn:hover { opacity: 0.9; }
.btn:active { transform: translateY(1px); }

.btn-quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-strong);
}

.btn-quiet:hover { border-color: var(--ink-3); opacity: 1; }

.text-link {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.text-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- hero ---------- */

.hero {
  padding: var(--space-6) 0 var(--space-5);
  background: linear-gradient(180deg, var(--wash), transparent 60%);
}

/* Tinted bands — alternating section backgrounds, full-bleed */
.band { background: var(--band); }

.hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: var(--space-5);
  align-items: center;
}

.hero .eyebrow { margin-bottom: var(--space-2); }

.hero h1 {
  font-size: var(--text-xl);
  letter-spacing: -0.025em;
  margin-bottom: var(--space-3);
  max-width: 18ch;
}

.hero .lede {
  color: var(--ink-2);
  max-width: 46ch;
  margin-bottom: var(--space-4);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.portrait-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  color: var(--ink-3);
}

.portrait-fallback .monogram {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.portrait-fallback .caption {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* Portrait slideshow: stacked slides crossfade; tap or dots to switch */
.portrait { cursor: pointer; }

.portrait .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 900ms ease;
}

.portrait .slide.is-active { opacity: 1; }

.portrait-dots {
  position: absolute;
  bottom: 0.7rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
  z-index: 2;
}

.portrait-dots button {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  transition: background 150ms ease, transform 150ms ease;
}

.portrait-dots button:hover { transform: scale(1.25); }

.portrait-dots button.active { background: var(--accent); }

.portrait img ~ .portrait-fallback { display: none; }
.portrait img.missing { display: none; }
.portrait img.missing ~ .portrait-fallback { display: flex; }

/* ---------- stat row (ledger line) ---------- */

.stats {
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}

.stat { display: flex; flex-direction: column; }
.stat .value { order: -1; } /* figure above its label, ledger-style */

.stat .value {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stat .label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 0.35rem;
}

.stat .context {
  font-size: var(--text-sm);
  color: var(--ink-2);
  margin-top: var(--space-1);
  max-width: 30ch;
}

/* ---------- affiliations ---------- */

.affiliations { padding: var(--space-4) 0; }

.affiliations .label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--space-2);
}

.affiliations ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  column-gap: var(--space-4);
  row-gap: var(--space-2);
}

.affiliations li {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Mixed-style brand marks unified as ink silhouettes; white in dark mode */
.logo-row { align-items: center; }

.logo-row img {
  display: block;
  height: 1.9rem;
  width: auto;
  filter: grayscale(1) brightness(0) opacity(0.5);
  transition: filter 150ms ease;
}

.logo-row li:hover img { filter: grayscale(1) brightness(0) opacity(0.8); }

[data-theme="dark"] .logo-row img {
  filter: grayscale(1) brightness(0) invert(1) opacity(0.55);
}

[data-theme="dark"] .logo-row li:hover img {
  filter: grayscale(1) brightness(0) invert(1) opacity(0.85);
}

/* Detailed crests lose legibility as flat silhouettes — keep their
   internal contrast, just desaturated (inverted to light in dark mode) */
.logo-row img.crest { filter: grayscale(1) opacity(0.55); }
.logo-row li:hover img.crest { filter: grayscale(1) opacity(0.85); }

[data-theme="dark"] .logo-row img.crest {
  filter: grayscale(1) invert(1) opacity(0.6);
}

[data-theme="dark"] .logo-row li:hover img.crest {
  filter: grayscale(1) invert(1) opacity(0.9);
}

/* ---------- sections ---------- */

.section { padding: var(--space-5) 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-2);
  margin-bottom: var(--space-4);
}

.section-head h2 { font-size: var(--text-lg); }

.section-num {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-right: 0.75rem;
  vertical-align: 0.35em;
}

/* ---------- competencies ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
}

.pillar {
  border-top: 1px solid var(--border);
  padding-top: var(--space-2);
}

.pillar .index {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.pillar h3 {
  font-size: var(--text-md);
  margin: var(--space-1) 0 var(--space-2);
}

.pillar ul { list-style: none; }

.pillar li {
  font-size: var(--text-sm);
  color: var(--ink-2);
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.pillar li:last-child { border-bottom: none; }

/* ---------- about: intro ---------- */

.about-intro {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--space-5);
  align-items: start;
}

.pull-quote {
  font-family: var(--font-body);
  font-style: italic;
  font-weight: 400;
  font-size: var(--text-lg);
  line-height: 1.4;
  color: var(--ink);
  border-left: 2px solid var(--accent);
  padding-left: var(--space-3);
}


.about-narrative p { margin-bottom: var(--space-3); color: var(--ink-2); }
.about-narrative p:first-child { color: var(--ink); }


/* ---------- about: timeline ---------- */

.timeline { list-style: none; }

.timeline > li {
  display: grid;
  grid-template-columns: 3fr 9fr;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.timeline .when {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.timeline h3 { font-size: var(--text-md); }

.timeline .org {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
  margin-top: 0.15rem;
}

.timeline ul {
  list-style: none;
  margin-top: var(--space-1);
}

.timeline ul li {
  font-size: var(--text-sm);
  color: var(--ink-2);
  padding: 0.25rem 0;
}

/* ---------- recognition ledger & insights ---------- */

.rec-tag {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* Recognition rows with photo evidence: tag | content | thumbnails */
.timeline > li.has-photos { grid-template-columns: 3fr 6fr 3fr; }

.row-photos {
  display: flex;
  gap: var(--space-1);
  justify-content: flex-end;
  align-items: flex-start;
  flex-wrap: wrap;
}

.row-photos img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 200ms ease;
}

.row-photos img:hover { transform: scale(1.04); }

.row-photos img { cursor: zoom-in; }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3);
  background: rgba(10, 12, 14, 0.88);
}

.lightbox.open { display: flex; }

.lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  max-width: min(64rem, 90vw);
}

.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: var(--radius);
}

.lightbox figcaption {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: #d4d4d8;
  text-align: center;
  max-width: 52ch;
}

.lightbox button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius);
  color: #f4f4f2;
  font-size: 1.1rem;
  line-height: 1;
  width: 2.5rem;
  height: 2.5rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 150ms ease;
}

.lightbox button:hover { border-color: rgba(255, 255, 255, 0.7); }

.lightbox .lightbox-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  font-size: 1.5rem;
}

@media (max-width: 40rem) {
  .lightbox .lightbox-prev, .lightbox .lightbox-next {
    position: absolute;
    bottom: var(--space-3);
  }
  .lightbox .lightbox-prev { left: var(--space-3); }
  .lightbox .lightbox-next { right: var(--space-3); }
}

.article-feature .article-tag { margin-bottom: var(--space-2); }

.article-feature h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  max-width: 24ch;
  margin-bottom: var(--space-2);
}

.article-feature .excerpt {
  color: var(--ink-2);
  max-width: 52ch;
  margin-bottom: var(--space-2);
}

.article-feature .meta {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: var(--space-3);
}

/* ---------- contact ---------- */

.contact {
  padding: var(--space-5) 0 var(--space-4);
}

.contact-grid {
  display: grid;
  grid-template-columns: 6fr 6fr;
  gap: var(--space-4);
  /* bounded by rules on both sides, so pad symmetrically; keeps the
     rule-to-heading gap close to the other sections' rhythm */
  padding: var(--space-3) 0;
  align-items: center;
}

.contact h2 { font-size: var(--text-lg); margin-bottom: var(--space-2); }

.contact .note { color: var(--ink-2); max-width: 40ch; }

.contact-icons {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.contact-icons a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
}

.contact-icons .tile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--ink-2);
  background: var(--bg);
  transition: color 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.contact-icons a:hover .tile {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.contact-icons .caption {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.contact-icons a:hover .caption { color: var(--ink); }


.colophon {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--ink-3);
}

/* ---------- reveal on load ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.reveal { animation: rise 480ms ease-out both; }
.reveal:nth-child(2) { animation-delay: 70ms; }
.reveal:nth-child(3) { animation-delay: 140ms; }
.reveal:nth-child(4) { animation-delay: 210ms; }
.reveal:nth-child(5) { animation-delay: 280ms; }

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

/* ---------- responsive ---------- */

@media (max-width: 40rem) {
  .hero { padding: var(--space-4) 0; }
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-4); }
  .hero-grid .portrait { order: -1; max-width: 16rem; }
  .stats { grid-template-columns: 1fr; gap: var(--space-3); }
  .pillars { grid-template-columns: 1fr; }
  .about-intro { grid-template-columns: 1fr; gap: var(--space-3); }
  .timeline > li { grid-template-columns: 1fr; gap: var(--space-1); }
  .timeline > li.has-photos { grid-template-columns: 1fr; }
  .row-photos { justify-content: flex-start; }
  .contact-grid { grid-template-columns: 1fr; }
  .site-nav { gap: var(--space-2); }
}
