/* ============================================================
   jourjon.net — styles
   A small, restrained stylesheet. No framework. Light + dark aware.
   ============================================================ */

:root {
  --bg: #fbfbf9;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5a636e;
  --border: #e4e2dc;
  --accent: #2f5d50;        /* muted teal-green */
  --accent-ink: #ffffff;
  --accent-soft: #eaf1ee;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 12px rgba(0, 0, 0, .04);
  --radius: 10px;
  --wrap: 46rem;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
          Arial, "Noto Sans", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a;
    --surface: #1c2024;
    --text: #e7e9ea;
    --muted: #9aa4ad;
    --border: #2c3238;
    --accent: #6bbfa6;
    --accent-ink: #0f1214;
    --accent-soft: #1e2926;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 12px rgba(0, 0, 0, .25);
  }
}

/* ---- base ---- */
* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 1.25rem; }

main.wrap { flex: 1 0 auto; padding-block: 2.5rem 3.5rem; }

h1 { font-size: 1.9rem; line-height: 1.2; margin: 0 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; margin: 2rem 0 .6rem; }

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

p { margin: 0 0 1rem; }

.muted { color: var(--muted); }
.lede { font-size: 1.15rem; color: var(--muted); }
code { background: var(--accent-soft); padding: .1em .35em; border-radius: 5px; font-size: .9em; }

/* ---- accessibility helpers ---- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: .5rem; top: -3rem; z-index: 100;
  background: var(--accent); color: var(--accent-ink);
  padding: .5rem .9rem; border-radius: 6px; transition: top .15s;
}
.skip-link:focus { top: .5rem; }

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

/* ---- header / nav ---- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky; top: 0; z-index: 20;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; font-size: 1.05rem; }
.brand:hover { color: var(--accent); text-decoration: none; }

.nav-list { list-style: none; display: flex; gap: 1.15rem; margin: 0; padding: 0; }
.nav-list a {
  color: var(--muted); text-decoration: none; font-size: .96rem;
  padding: .35rem 0; border-bottom: 2px solid transparent;
}
.nav-list a:hover { color: var(--text); }
.nav-list a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

.nav-toggle { display: none; }

/* ---- footer ---- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
.footer-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding-block: 1.25rem; flex-wrap: wrap;
}
.footer-copy { margin: 0; color: var(--muted); font-size: .9rem; }

/* ---- social row ---- */
.social-row { list-style: none; display: flex; gap: .35rem; margin: 0; padding: 0; }
.social-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; border-radius: 8px; color: var(--muted);
}
.social-link:hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.icon { display: block; }

/* ---- buttons ---- */
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink);
  padding: .55rem 1.1rem; border-radius: 8px; text-decoration: none;
  font-size: .96rem; font-weight: 600; border: 1px solid transparent; cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--border); }
.btn-ghost:hover { background: var(--accent-soft); }

/* ---- home / hero ---- */
.hero { display: flex; gap: 1.75rem; align-items: flex-start; }
.headshot { margin: 0; flex-shrink: 0; }
.headshot img {
  width: 160px; height: 160px; border-radius: 50%; object-fit: cover;
  border: 1px solid var(--border);
}
.hero-text { min-width: 0; }
.hero-list { margin: .2rem 0 0; padding-left: 1.2rem; }
.hero-list li { margin-bottom: .25rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---- publications ---- */
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.pub:last-child { border-bottom: 0; }
.pub-title { margin: 0 0 .2rem; font-weight: 600; }
.pub-meta { margin: 0; color: var(--muted); font-size: .95rem; }
.pub-venue { font-style: italic; }

.tag {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px;
  margin-left: .4rem; vertical-align: middle;
}

/* ---- projects ---- */
.projects-section { margin-top: 2.5rem; }
.projects-section:first-of-type { margin-top: 1.25rem; }
.section-title {
  font-size: 1.25rem; margin: 0 0 1.1rem; padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
}
.project-grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.15rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.card-title { margin: 0 0 .2rem; font-size: 1.1rem; }
.card-role {
  margin: 0 0 .55rem; color: var(--accent); font-weight: 600;
  font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
}
.card-desc { margin: 0 0 .7rem; color: var(--muted); font-size: .95rem; }
.card-points {
  margin: 0 0 .9rem; padding-left: 1.1rem; color: var(--muted);
  font-size: .92rem; line-height: 1.5;
}
.card-points li { margin-bottom: .3rem; }
.point-label { color: var(--text); font-weight: 600; }
/* Push the tag/link footer to the bottom so cards in a row line up. */
.tag-row { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; margin: auto 0 .8rem; padding: 0; }
.tag-row .tag { margin-left: 0; }
.card-links { margin: 0; display: flex; gap: 1rem; font-size: .92rem; }

/* ---- CV ---- */
.cv-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.cv-head h1 { margin-bottom: .2rem; }
.cv-head .lede { margin: 0; font-size: 1.05rem; }
.cv-section { margin-top: 1.75rem; }
.cv-section h2 {
  font-size: 1.15rem; margin: 0 0 .9rem; padding-bottom: .35rem;
  border-bottom: 1px solid var(--border);
}
.cv-entry {
  display: grid; grid-template-columns: 8rem 1fr; gap: 1rem;
  margin-bottom: .7rem; align-items: start;
}
.cv-entry p { margin: 0; }
.cv-date { color: var(--muted); font-size: .85rem; padding-top: .12rem; }
.cv-list { margin: 0; padding-left: 1.1rem; }
.cv-list li { margin-bottom: .3rem; }
.cv-pubs { margin: 0 0 .6rem; padding-left: 1.2rem; }
.cv-pubs li { margin-bottom: .55rem; }

@media (max-width: 40rem) {
  .cv-entry { grid-template-columns: 1fr; gap: .1rem; margin-bottom: 1rem; }
  .cv-date { padding-top: 0; }
}

/* ---- contact form ---- */
.contact-form { max-width: 34rem; margin-top: 1.5rem; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .35rem; font-size: .95rem; }
.field input, .field textarea {
  width: 100%; padding: .6rem .7rem; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); outline-offset: 0; }
.field textarea { resize: vertical; }

/* Honeypot — visually hidden but present in the DOM for bots. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---- flash messages ---- */
.flashes { margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: .6rem; }
.flash { padding: .7rem 1rem; border-radius: 8px; border: 1px solid transparent; font-size: .95rem; }
.flash-success { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.flash-error {
  background: #fdecea; color: #922b21; border-color: #e6b0aa;
}
@media (prefers-color-scheme: dark) {
  .flash-error { background: #3a1f1c; color: #f0b5ad; border-color: #6b3a34; }
}

/* ---- responsive ---- */
@media (max-width: 40rem) {
  .hero { flex-direction: column; align-items: center; text-align: center; }
  .hero-actions { justify-content: center; }

  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.6rem; height: 2.6rem; background: transparent; border: 1px solid var(--border);
    border-radius: 8px; cursor: pointer; position: relative; color: var(--text);
  }
  .nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
    content: ""; position: absolute; width: 1.1rem; height: 2px; background: currentColor; border-radius: 2px;
  }
  .nav-toggle-bar::before { transform: translateY(-6px); }
  .nav-toggle-bar::after  { transform: translateY(6px); }

  .nav-list {
    display: none; position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column; gap: 0; background: var(--surface);
    border-bottom: 1px solid var(--border); padding: .5rem 1.25rem 1rem;
  }
  .site-nav { position: static; }
  .nav-list.open { display: flex; }
  .nav-list a { padding: .6rem 0; border-bottom: 1px solid var(--border); }
  .nav-list li:last-child a { border-bottom: 0; }
}

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