/* ------------------------------------------------------------
   Francesco Axel Pio Romio — personal site
   Palette: basalt dust, rock ink, olivine, survey blue
   ------------------------------------------------------------ */

:root {
  --bg: #f1f2f0;
  --ink: #1c2024;
  --muted: #5d656c;
  --line: #cdd2d4;
  --accent: #4f6b2e;      /* olivine: the green mineral of basaltic lava */
  --link: #2c5b78;        /* survey blue */
  --tube: #1c2024;
  --tube-near: #4f6b2e;

  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 66ch;
  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-4: clamp(2.6rem, 6vw, 4.4rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181b;
    --ink: #e6e8e6;
    --muted: #9aa2a8;
    --line: #2f3539;
    --accent: #9cbc6a;
    --link: #8cbfdc;
    --tube: #e6e8e6;
    --tube-near: #9cbc6a;
  }
}

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

html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}

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

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--bg); padding: .5rem .75rem; z-index: 10; }

/* ---------- layout ---------- */

.page {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 900px) {
  .page {
    grid-template-columns: 210px minmax(0, 1fr);
    column-gap: 4rem;
    padding: 0 2.5rem;
  }
}

/* ---------- side navigation ---------- */

.side {
  min-width: 0;
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: .75rem 0;
}

.side .who {
  font-weight: 700;
  font-variation-settings: "wdth" 112;
  text-decoration: none;
  color: var(--ink);
  font-size: var(--step--1);
  display: none;
}

.side ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 1.1rem;
  overflow-x: auto;
  scrollbar-width: none;
  font-size: var(--step--1);
}
.side ul::-webkit-scrollbar { display: none; }
.side a { color: var(--muted); text-decoration: none; white-space: nowrap; }
.side a:hover, .side a[aria-current="true"] { color: var(--ink); }

@media (min-width: 900px) {
  .side {
    height: 100vh;
    border-bottom: 0;
    padding: 3rem 0;
    display: flex;
    flex-direction: column;
    gap: 2rem;
  }
  .side .who { display: block; }
  .side ul { flex-direction: column; gap: .55rem; overflow: visible; font-size: var(--step-0); }
  .side a[aria-current="true"] { box-shadow: inset 2px 0 0 var(--accent); padding-left: .7rem; }
  .side .elsewhere { margin-top: auto; }
}

.elsewhere { display: none; }
@media (min-width: 900px) {
  .elsewhere { display: flex; flex-direction: column; gap: .3rem; font-size: var(--step--1); }
  .elsewhere a { color: var(--muted); }
}

/* ---------- hero ---------- */

.hero { padding: 3rem 0 2rem; }

.hero h1 {
  font-size: var(--step-4);
  line-height: 0.98;
  font-weight: 800;
  font-variation-settings: "wdth" 118;
  letter-spacing: -0.01em;
  margin: 0 0 1.25rem;
}

.hero .lede {
  font-size: var(--step-1);
  line-height: 1.4;
  max-width: 34ch;
  margin: 0 0 1rem;
}

.hero .affil { color: var(--muted); max-width: var(--measure); margin: 0; }

.tube {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  margin: 2rem 0 .5rem;
}
.tube path { fill: none; stroke: var(--tube); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tube path.near { stroke: var(--tube-near); stroke-width: 2; opacity: 1 !important; }

.tube-caption { font-size: var(--step--1); color: var(--muted); margin: 0; max-width: 52ch; }

@media (prefers-reduced-motion: no-preference) {
  .tube path {
    stroke-dasharray: 1;
    stroke-dashoffset: 1;
    animation: draw 1.1s cubic-bezier(.4, 0, .2, 1) forwards;
    animation-delay: calc(var(--i) * 45ms);
  }
  @keyframes draw { to { stroke-dashoffset: 0; } }
}

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

main section { padding: 3rem 0 1rem; border-top: 1px solid var(--line); }
main section:first-of-type { border-top: 0; }

h2 {
  font-size: var(--step-2);
  font-weight: 750;
  font-variation-settings: "wdth" 112;
  line-height: 1.15;
  margin: 0 0 .5rem;
}

.section-intro { color: var(--muted); max-width: var(--measure); margin: 0 0 2rem; }

/* entries: a year/status column and a body column, like a CV */
.entries { list-style: none; margin: 0; padding: 0; }

.entry {
  display: grid;
  grid-template-columns: 1fr;
  gap: .15rem 1.5rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--line);
}
.entry:first-child { border-top: 0; padding-top: 0; }

@media (min-width: 640px) {
  .entry { grid-template-columns: 6.5rem minmax(0, 1fr); }
}

.entry .when { color: var(--muted); font-size: var(--step--1); padding-top: .2rem; font-variant-numeric: tabular-nums; }
.entry h3 { font-size: var(--step-0); font-weight: 650; line-height: 1.35; margin: 0 0 .3rem; max-width: var(--measure); }
.entry p { margin: 0 0 .4rem; max-width: var(--measure); }
.entry .authors { color: var(--muted); font-size: var(--step--1); }
.entry .venue { font-style: italic; }
.me { color: var(--ink); font-weight: 600; }

.links { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: var(--step--1); margin-top: .35rem; }

.status {
  display: inline-block;
  font-size: .78rem;
  color: var(--accent);
  border: 1px solid currentColor;
  border-radius: 999px;
  padding: 0 .5rem;
  margin-left: .35rem;
  vertical-align: .12em;
  font-weight: 500;
}

/* research themes: two columns of prose on wide screens */
.themes { display: grid; gap: 2rem 3rem; }
@media (min-width: 760px) { .themes { grid-template-columns: 1fr 1fr; } }
.themes h3 { font-size: var(--step-0); font-weight: 650; margin: 0 0 .35rem; }
.themes p { margin: 0; color: var(--ink); }

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

footer {
  border-top: 1px solid var(--line);
  margin-top: 3rem;
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: var(--step--1);
}
footer .contact { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; margin-bottom: 1rem; }
