/* ==========================================================
   Justin Dallant – website style
   Colours, fonts and the hand-drawn decorations live here;
   index.html only holds the content.
   ========================================================== */

/* ---------- Fonts (my handwriting) ---------- */
@font-face { font-family: "Justin"; src: url("fonts/Justin-Regular.woff2") format("woff2");
             font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Justin"; src: url("fonts/Justin-Bold.woff2") format("woff2");
             font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Justin"; src: url("fonts/Justin-Italic.woff2") format("woff2");
             font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Justin"; src: url("fonts/Justin-BoldItalic.woff2") format("woff2");
             font-weight: 700; font-style: italic; font-display: swap; }

/* ---------- Colours (taken from the slides) ---------- */
:root {
  --paper:  #fdfcf8;
  --ink:    #16161a;
  --muted:  #5d5d68;
  --line:   #e4e1d8;   /* faint rules and dots */
  --red:    #db162a;
  --blue:   #0000b4;
  --green:  #67a045;
  --gold:   #e6b040;
  --link:   var(--blue);
  --highlight: #f8e7c6;   /* cream marker highlight, e.g. behind the award */
}

/* Dark version, used automatically when the visitor's system is in dark mode.
   Delete this block to always show the light version. */
@media (prefers-color-scheme: dark) {
  :root {
    --paper:  #23252e;
    --ink:    #e9e6df;
    --muted:  #a3a3ad;
    --line:   #363946;
    --red:    #ff5e6b;
    --blue:   #8c96ff;
    --green:  #86c46a;
    --gold:   #efc25e;
    --link:   #98c5ff;
    --highlight: #4a3f2a;
  }
}

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

html { font-size: 22px; }

body {
  margin: 0;
  background-color: var(--paper);
  /* a faint grid of points behind the top of the page, fading out further down */
  background-image:
    linear-gradient(to bottom, transparent 0, transparent 260px, var(--paper) 620px),
    radial-gradient(circle, var(--line) 1.5px, transparent 2px);
  background-size: 100% 100%, 26px 26px;
  background-repeat: no-repeat, repeat;
  color: var(--ink);
  font-family: "Justin", "Segoe Print", "Bradley Hand", system-ui, sans-serif;
  /* ss01 = real lowercase letters; "rand" 0 keeps each word looking the same */
  font-feature-settings: "ss01", "rand" 0;
  line-height: 1.5;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline wavy; text-decoration-thickness: 1px; text-underline-offset: 3px; }

main, header { max-width: 1160px; margin: 0 auto; padding: 0 28px; }

/* Text in the font's own small capitals (like on the slides) */
h1, h2, .venue, .role, .updated {
  font-feature-settings: "rand" 0;
  font-weight: 400;
}

/* ---------- Header ---------- */
header {
  display: flex;
  align-items: center;
  gap: 48px;
  padding-top: 56px;
  padding-bottom: 24px;
}

.photo {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border: 3px solid var(--ink);
  border-radius: 10px;
  box-shadow: 9px 9px 0 var(--gold);
  transform: rotate(-2deg);
  flex-shrink: 0;
}

.intro { flex: 1; min-width: 0; }

h1 {
  font-size: 3.4rem;
  line-height: 1;
  margin: 0;
}

.lines {               /* the woven lines under my name */
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 10px 0 14px -8px;
}

.role { font-size: 1.3rem; margin: 0 0 6px; }

.contact { margin: 0; color: var(--muted); }
.contact a { margin-left: 18px; white-space: nowrap; }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: 1.15fr 1fr;   /* text | drawing */
  gap: 44px;
  align-items: center;
  margin-top: 30px;
  font-size: 1.08rem;
}
.hero { width: 100%; height: auto; }   /* the pseudoline arrangement */

/* ---------- Section titles, framed like on the slides ---------- */
h2 {
  width: fit-content;
  font-size: 1.9rem;
  line-height: 1.2;
  margin: 64px 0 22px -14px;
  padding: 17px 30px 7px 32px;    /* more space on top: the frame sits a bit higher */
  background:
    url("drawings/corner-tl.svg") left top / 34px no-repeat,
    url("drawings/corner-tr.svg") right 2px top 6px / 22px no-repeat,
    url("drawings/corner-bl.svg") left 8px bottom 2px / 20px no-repeat,
    url("drawings/corner-br.svg") right bottom / 26px no-repeat;
}

/* ---------- Interests ---------- */
.interests {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  text-align: center;
}
.interests img {
  display: block;
  height: 86px;
  max-width: 100%;
  margin: 0 auto 10px;
}

/* ---------- Lists: small hand-drawn points as bullets ---------- */
main ul { list-style: none; padding-left: 22px; }
main li { position: relative; }
main li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 0.52em;
  width: 7px;
  height: 7px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.interests li::before { content: none; }
.note li::before { width: 5px; height: 5px; border-width: 1.5px; left: -16px; }

/* ---------- Publications ---------- */
.updated { color: var(--muted); margin: -12px 0 26px; font-size: 0.9rem; }

.pubs { margin: 0 230px 0 0; }   /* the right margin holds the drawings */
.pubs > li { margin: 0 0 56px; color: var(--muted); }
.pubs > li > a {             /* paper title on its own line */
  display: block;
  font-size: 1.1rem;
  color: var(--link);
}

.venue {                     /* like the citations on the slides: [ESA 2024] */
  color: var(--red);
  white-space: nowrap;
}
.venue::before, .journal::before { content: "["; }
.venue::after,  .journal::after  { content: "]"; }

.pubs .journal {             /* link to the journal version, next to the venue */
  display: inline;
  font-size: 1rem;
  font-feature-settings: "rand" 0;
  white-space: nowrap;
}

.award {                     /* best paper award, highlighted like on the slides */
  display: inline-block;
  font-feature-settings: "rand" 0;
  color: var(--ink);
  background: var(--highlight);
  border-radius: 10px;
  padding: 1px 10px 0 6px;
  margin-top: 3px;
  white-space: nowrap;
}
.award img { height: 1.15em; width: auto; vertical-align: -0.22em; margin-right: 6px; }

.note { font-size: 0.85rem; margin-top: 6px; }
.note ul { margin: 4px 0 0; padding-left: 18px; }

/* Drawings in the right margin, vertically centred on their paper.
   Each drawing stays within the height of its own entry (plus the gap),
   so drawings of neighbouring papers never overlap. */
.margin {
  position: absolute;
  right: -230px;
  top: 50%;
  transform: translateY(-50%);
  width: 170px;
  height: calc(100% + 32px);
  max-height: 140px;
  object-fit: contain;
}

/* ---------- Teaching / Education ---------- */
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.two-columns li { margin-bottom: 8px; }

.muted { color: var(--muted); }

.flag {                      /* small country flags */
  height: 1.05em;
  width: auto;
  vertical-align: -0.15em;
  margin-left: 4px;
}

.places { padding-left: 0; }               /* institutions, with their courses below */
.places > li { margin-bottom: 14px; }
.places > li::before { content: none; }
.places ul { margin: 6px 0 0; }

h2 .icon {                   /* small drawing inside a section title */
  height: 0.85em;
  width: auto;
  margin-left: 6px;
  vertical-align: -0.05em;
}

/* ---------- Footer ---------- */
footer {
  max-width: 1060px;
  margin: 80px auto 0;
  padding: 0 28px 50px;
  text-align: center;
}
footer img { display: block; width: 360px; max-width: 80%; margin: 0 auto; }
footer p {
  font-feature-settings: "rand" 0;
  color: var(--red);
  font-size: 1.6rem;
  margin: 10px 0 0;
  transform: rotate(-4deg);
}


/* ---------- Smaller screens ---------- */
@media (max-width: 1000px) {         /* less room: a narrower margin with smaller drawings */
  .pubs { margin-right: 150px; }
  .margin { right: -150px; width: 125px; max-height: 95px; }
}

@media (max-width: 760px) {
  html { font-size: 17px; }
  header { flex-direction: column; text-align: center; gap: 26px; padding-top: 36px; }
  .photo { width: 160px; height: 160px; }
  .lines { margin: 8px auto 12px; }
  .contact .email { display: block; margin-bottom: 4px; }
  .contact a { margin: 0 8px; }
  .about { grid-template-columns: 1fr; gap: 10px; }
  .hero { grid-row: 1; }
  .interests { grid-template-columns: 1fr 1fr; }
  .two-columns { grid-template-columns: 1fr; gap: 0; }
  .pubs { margin-right: 0; }
  .margin { display: none; }
  .award { white-space: normal; }
  h2 { margin-left: -8px; }
}
