/* Giuseppe Vitagliano, personal website.
   Plain HTML and CSS: no JavaScript, no cookies, no requests to other sites. */

/* Source Serif 4 (SIL Open Font License), stored in assets/fonts */
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/source-serif-4-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("assets/fonts/source-serif-4-latin-ext-wght-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Colours and fonts used everywhere */
:root {
  --bg: #ffffff;
  --ink: #1f2328;
  --muted: #5b6570;
  --soft: #858e98;
  --rule: #e4e7eb;
  --accent: #2b4c8c;
  --accent-deep: #1b3263;
  --serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.wrap {
  max-width: 52rem;
  margin-inline: auto;
  padding-inline: 1.5rem;
}

a {
  color: var(--accent);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(43, 76, 140, 0.35);
  text-underline-offset: 0.18em;
}
a:hover { color: var(--accent-deep); text-decoration-color: currentColor; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

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

p { margin: 0 0 1rem; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* Top bar */
.topbar { border-bottom: 1px solid var(--rule); }
.topbar .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1.5rem;
  padding-block: 0.9rem;
  font-family: var(--sans);
  font-size: 0.875rem;
}
.topbar .home { color: var(--ink); font-weight: 600; text-decoration: none; }
.topbar ul { display: flex; flex-wrap: wrap; gap: 0.2rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.topbar nav a { color: var(--muted); text-decoration: none; }
.topbar nav a:hover { color: var(--accent); }

/* Name, portrait and profile links */
.intro {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  align-items: center;
  gap: 1.75rem;
  padding-block: 3rem 0.5rem;
}
.portrait {
  width: 9.5rem;
  aspect-ratio: 1;
  object-fit: cover;
  object-position: 50% 22%;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: #f3f4f6;
}
h1 {
  margin: 0 0 0.3rem;
  font-size: 2.25rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.role { margin: 0; color: var(--muted); line-height: 1.45; }
.profiles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 0.875rem;
}

.about { padding-top: 1.75rem; }

/* Keep running text at a comfortable line length */
.about p, .lead-in, #publications > p, #contact p, address { max-width: 40rem; }

/* Section headings */
h2 {
  margin: 3rem 0 1rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.25;
}
h3 {
  margin: 0 0 0.55rem;
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.35;
  text-wrap: balance;
}
.lead-in { color: var(--muted); }

/* Research questions: figure on the left, heading and text on the right */
.topic {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "fig head" "fig body";
  column-gap: 2rem;
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule);
}
.topic h3 { grid-area: head; }
.topic figure { grid-area: fig; margin: 0.25rem 0 0; }
.topic-body { grid-area: body; }
.topic img { width: 100%; }
.topic figcaption {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  font-style: italic;
  line-height: 1.4;
  color: var(--muted);
}
.topic p { margin-bottom: 0.8rem; }
.key-label {
  margin: 1rem 0 0.2rem !important;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--soft);
}
.key { margin: 0; padding: 0; list-style: none; font-size: 0.97rem; line-height: 1.45; }
.key li + li { margin-top: 0.35rem; }
.venue {
  font-family: var(--sans);
  font-size: 0.76rem;
  color: var(--soft);
  white-space: nowrap;
}

/* Career */
.cv, .pubs { margin: 0; padding: 0; list-style: none; }
.cv li {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  gap: 1.25rem;
  padding-block: 0.7rem;
  border-top: 1px solid var(--rule);
  line-height: 1.5;
}
.when {
  padding-top: 0.2rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.cv small { display: block; margin-top: 0.15rem; font-size: 0.92rem; line-height: 1.45; color: var(--muted); }

/* Publications */
.pubs li { padding-block: 0.8rem; border-top: 1px solid var(--rule); line-height: 1.45; }
.authors, .venue-line { display: block; font-size: 0.95rem; color: var(--muted); }
.authors b { font-weight: 600; color: var(--ink); }
.venue-line { margin-top: 0.1rem; }

/* Contact */
address { margin: 0 0 1rem; font-style: normal; color: var(--muted); }
.invite { color: var(--muted); }

/* Footer */
footer { margin-top: 3.5rem; border-top: 1px solid var(--rule); }
footer .wrap { padding-block: 1.2rem 2rem; font-family: var(--sans); font-size: 0.8rem; color: var(--soft); }

/* Phones */
@media (max-width: 40rem) {
  body { font-size: 1.0625rem; }
  .wrap { padding-inline: 1.1rem; }
  .intro { grid-template-columns: 1fr; gap: 1rem; padding-top: 2rem; }
  .portrait { width: 6.5rem; }
  h1 { font-size: 1.8rem; }
  .topic { grid-template-columns: 1fr; grid-template-rows: auto; grid-template-areas: "head" "fig" "body"; }
  .topic figure { max-width: 13rem; margin: 0.4rem 0 1rem; }
  .cv li { grid-template-columns: 1fr; gap: 0.1rem; }
}
