/* Alexandre Morgand — personal site
   One stylesheet, no dependencies, no fonts to download. */

:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --ink: #17191d;
  --muted: #626973;
  --faint: #8b929c;
  --rule: #e5e2da;
  --card: #f1efe9;
  --accent: #2f6fb5;
  --accent-soft: #e8f0f9;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #101216;
    --ink: #e9e7e2;
    --muted: #9aa1ab;
    --faint: #737b86;
    --rule: #242830;
    --card: #181b21;
    --accent: #7fb0e8;
    --accent-soft: #17222f;
  }
}
:root[data-theme="dark"] {
    --bg: #101216;
    --ink: #e9e7e2;
    --muted: #9aa1ab;
    --faint: #737b86;
    --rule: #242830;
    --card: #181b21;
    --accent: #7fb0e8;
    --accent-soft: #17222f;
  }

* { box-sizing: border-box; }

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

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

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 28px 72px;
}

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

p { margin: 0 0 0.85em; }

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 208px;
  gap: 48px;
  align-items: start;
  padding-top: 72px;
}

h1 {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 46px);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.05;
  margin: 0 0 6px;
}

.tagline {
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 0.01em;
  margin: 0 0 26px;
}

.hero-text p { max-width: 58ch; }

.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  margin: 20px 0 0 -7px;
}
.links a {
  display: inline-flex;
  padding: 7px;
  border-radius: 8px;
  color: var(--muted);
  transition: color 0.15s ease, background-color 0.15s ease;
}
.links a:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

.theme-toggle {
  display: inline-flex;
  padding: 7px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.theme-toggle:hover { color: var(--accent); background: var(--accent-soft); }
.theme-toggle[hidden] { display: none; }
.theme-toggle .sun { display: none; }

.links svg {
  width: 21px;
  height: 21px;
  display: block;
  fill: currentColor;
}
.links svg.brand {
  width: 19px;
  height: 19px;
}

.where {
  margin-top: 12px;
  font-size: 13px;
  color: var(--faint);
}

.hero-photo img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* Poster and 3D canvas share one tile, so the hand-off is pixel-identical:
   the poster is the splat's own first frame (assets/face/poster.*, transparent). */
.hero-photo img,
.face3d {
  background: #3b4a33 url("assets/face/bg.jpg") center / cover no-repeat; /* blurred foliage from the original photo */
  background-image: image-set(url("assets/face/bg.webp") type("image/webp"), url("assets/face/bg.jpg") type("image/jpeg"));
}

.hero-photo { position: relative; }

/* 3D face: drawn over the photo once the first splat frame exists (face.js adds .is-3d) */
.face3d {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  cursor: grab;
  touch-action: pan-y;
}
.face3d:active { cursor: grabbing; }
.is-3d .face3d { opacity: 1; pointer-events: auto; }
.face3d-note {
  display: none;
  margin: 8px 0 0;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: var(--faint);
  text-align: center;
}
.is-3d .face3d-note { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
  }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }

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

section { margin-top: 72px; }

h2 {
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--faint);
  margin: 0 0 26px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}

h3 {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0 0 3px;
  letter-spacing: -0.006em;
}

.logo {
  width: 36px;
  height: 36px;
  padding: 3px;
  box-sizing: border-box;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}

.timeline .when .logo {
  display: block;
  margin-top: 12px;
}

/* ---------- selected work ---------- */

.work {
  display: grid;
  grid-template-columns: 440px minmax(0, 1fr);
  gap: 24px 34px;
  align-items: start;
  padding: 26px 0;
  border-top: 1px solid var(--rule);
}
.work:first-of-type { border-top: 0; padding-top: 0; }
.work:last-of-type { padding-bottom: 0; }

.work .media {
  border-radius: 9px;
  overflow: hidden;
  background: var(--card);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .work .media { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07); }
}
:root[data-theme="dark"] .work .media { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07); }

.work video {
  display: block;
  width: 100%;
  height: auto;
}

.work p {
  margin: 0 0 10px;
  font-size: 14.5px;
  color: var(--muted);
  line-height: 1.55;
}

.work .meta {
  font-size: 12.5px;
  color: var(--faint);
  margin-bottom: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.tags li {
  font-size: 11.5px;
  color: var(--muted);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2.5px 9px;
  letter-spacing: 0.01em;
}

/* ---------- experience ---------- */

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}
.timeline li {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 24px;
  padding: 0 0 26px;
}
.timeline li + li {
  border-top: 1px solid var(--rule);
  padding-top: 26px;
}
.timeline .when {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.02em;
  margin: 2px 0 0;
}
.timeline p {
  margin: 0;
  font-size: 14.5px;
  color: var(--muted);
}
.place { color: var(--faint); font-weight: 400; }

/* ---------- publications ---------- */

.pubs {
  list-style: none;
  margin: 0;
  padding: 0;
}
.pubs li {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 18px;
  padding: 0 0 20px;
}
.pubs li + li {
  border-top: 1px solid var(--rule);
  padding-top: 20px;
}

/* publications with a paper teaser */
.papers li {
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  padding-bottom: 26px;
}
.papers li + li { padding-top: 26px; }

.teaser { margin: 0; }
.teaser img,
.teaser video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #0b0d11;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.teaser img { object-fit: cover; }

.pmeta {
  margin: 0;
  font-size: 12.5px;
  color: var(--faint);
  letter-spacing: 0.01em;
}
.year {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  margin: 3px 0 0;
}
.ptitle {
  margin: 0 0 2px;
  font-size: 15px;
  line-height: 1.45;
}
.pvenue {
  margin: 0;
  font-size: 13.5px;
  color: var(--faint);
}
.pvenue em { font-style: normal; color: var(--muted); }

.more {
  margin-top: 18px;
  font-size: 14px;
  color: var(--faint);
}
.more a {
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.more a:hover { text-decoration-color: currentColor; }

/* ---------- footer ---------- */

footer {
  margin-top: 84px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
}
footer p { margin: 0 0 4px; }
.fine { font-size: 12.5px; color: var(--faint); }

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

@media (max-width: 700px) {
  .wrap { padding: 0 20px 56px; }
  .hero {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-top: 44px;
  }
  .hero-photo {
    order: -1;
    width: 132px;
  }
  .face3d-note .wide { display: none; }
  .work { grid-template-columns: 1fr; gap: 14px; padding: 22px 0; }
  .timeline li, .pubs li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .papers li { gap: 12px; }
  .papers .teaser { max-width: 240px; }
  .timeline .when, .year { margin-top: 0; }
  .timeline .when .logo { display: inline-block; margin: 0 0 0 10px; vertical-align: -11px; }
  section { margin-top: 56px; }
}
