/* =========================================================
   Ghislain Atemezing — personal site
   Modern, responsive, dependency-free stylesheet
   ========================================================= */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;

  --bg: #f7f8fa;
  --bg-elevated: #ffffff;
  --bg-subtle: #eef1f5;
  --text: #1b2430;
  --text-muted: #566072;
  --text-faint: #7c8598;
  --border: #e1e5eb;
  --border-strong: #c7cedb;

  --brand: #0b5fa5;
  --brand-dark: #08447a;
  --brand-light: #e8f1fb;
  --accent: #d97706;
  --accent-light: #fdf1e0;

  --success: #157a4a;
  --success-light: #e5f5ed;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 14px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, 0.12);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;

  --container-w: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #10151d;
    --bg-elevated: #161d28;
    --bg-subtle: #1b2330;
    --text: #e7ebf1;
    --text-muted: #a8b2c2;
    --text-faint: #7a8496;
    --border: #262f3d;
    --border-strong: #333f52;

    --brand: #5fa8e8;
    --brand-dark: #8cc3f5;
    --brand-light: #16283b;
    --accent: #f0a94e;
    --accent-light: #2e2412;

    --success: #4fc989;
    --success-light: #142a20;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}

/* ---------- 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; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover { text-decoration: underline; }
a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 3px;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--space-3);
}
h1 { font-size: clamp(1.9rem, 1.5rem + 1.6vw, 2.75rem); }
h2 { font-size: clamp(1.4rem, 1.2rem + 0.8vw, 1.85rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 var(--space-4); }
.lead { font-size: 1.05rem; color: var(--text-muted); }

ul, ol { padding-left: 1.25em; }
li { margin-bottom: var(--space-2); }

.container {
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -3rem;
  background: var(--brand);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  z-index: 200;
  transition: top 0.15s ease;
}
.skip-link:focus { top: var(--space-4); text-decoration: none; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
  gap: var(--space-4);
}

.brand {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; color: var(--brand); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  color: var(--text);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
}
.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--brand);
  background: var(--brand-light);
  text-decoration: none;
}
.nav-links a.is-demo { color: var(--accent); }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; gap: var(--space-2); }
  .nav-links {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    padding: var(--space-3) var(--space-5) var(--space-4);
    box-shadow: var(--shadow-md);
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: var(--space-3); }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: var(--space-8) var(--space-7);
  background:
    radial-gradient(60% 90% at 85% -10%, var(--brand-light), transparent 60%),
    var(--bg);
}

.hero-grid {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--space-6);
  align-items: center;
}

.hero-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--bg-elevated);
  box-shadow: var(--shadow-lg);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: var(--space-2);
}

.hero-role {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.hero-quote {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--text-faint);
  border-left: 3px solid var(--border-strong);
  padding-left: var(--space-3);
  margin-bottom: var(--space-5);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: var(--bg-elevated); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(0.92); }
.btn-sm { padding: var(--space-2) var(--space-4); font-size: 0.85rem; }

.hero-social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
}

@media (max-width: 640px) {
  .hero-grid { grid-template-columns: 96px 1fr; gap: var(--space-4); }
  .hero-photo { border-width: 3px; }
}

/* ---------- Sections ---------- */
main { display: block; }

.section {
  padding-block: var(--space-7);
  border-bottom: 1px solid var(--border);
}
.section:last-of-type { border-bottom: none; }
.section-alt { background: var(--bg-subtle); }

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

.section-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: var(--space-1);
}

.back-to-toc {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-faint);
  white-space: nowrap;
}

/* ---------- Table of contents (mobile jump menu) ---------- */
.toc {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  list-style: none;
  padding: 0;
  margin: 0;
}
.toc a {
  display: inline-block;
  padding: var(--space-2) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.toc a:hover { color: var(--brand); border-color: var(--brand); text-decoration: none; }

/* ---------- Cards / grids ---------- */
.grid {
  display: grid;
  gap: var(--space-5);
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

/* Demo cards */
.demo-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.demo-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.demo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--brand-light);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.demo-icon svg { width: 24px; height: 24px; }

.demo-card h3 { margin-bottom: var(--space-2); }
.demo-card p { color: var(--text-muted); flex-grow: 1; }

.demo-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 2px var(--space-3);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

/* ---------- Badges (awards etc.) ---------- */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  vertical-align: middle;
  margin-left: var(--space-2);
}
.badge-award { background: var(--accent-light); color: var(--accent); }
.badge-role { background: var(--success-light); color: var(--success); }

/* ---------- Disclosure groups (details/summary) ---------- */
details.group {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0;
  margin-bottom: var(--space-3);
  overflow: hidden;
}
details.group > summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-4) var(--space-5);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--text);
}
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary::after {
  content: "+";
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-faint);
  flex-shrink: 0;
}
details.group[open] > summary::after { content: "\2212"; }
details.group > summary:hover { color: var(--brand); }
details.group .group-body {
  padding: 0 var(--space-5) var(--space-5);
  border-top: 1px solid var(--border);
  padding-top: var(--space-4);
}
details.group .group-body ul { margin: 0; }
details.group .count {
  font-weight: 500;
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* ---------- Publications ---------- */
.pub-list { list-style: none; padding: 0; margin: 0; }
.pub-list li {
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}
.pub-list li:last-child { border-bottom: none; }

/* ---------- Contact ---------- */
.contact-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  line-height: 2;
}
.contact-card .k { color: var(--text-faint); }

.map-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  aspect-ratio: 16 / 7;
  min-height: 260px;
  box-shadow: var(--shadow-sm);
}

/* ---------- Off-duty / personal picks ---------- */
.offduty {
  background: var(--bg-subtle);
}
.offduty ul { columns: 2; column-gap: var(--space-6); }
@media (max-width: 640px) { .offduty ul { columns: 1; } }

/* ---------- Footer ---------- */
.site-footer {
  padding-block: var(--space-6);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 0.88rem;
}
.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-4);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  list-style: none;
  padding: 0;
  margin: 0;
}

/* ---------- Back to top ---------- */
.to-top {
  position: fixed;
  right: var(--space-5);
  bottom: var(--space-5);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 90;
}
.to-top.is-visible { opacity: 1; pointer-events: auto; transform: translateY(0); }
.to-top:hover { background: var(--brand-dark); text-decoration: none; }
