@font-face {
  font-family: "Valley Sans";
  src: url("/fonts/valley-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Valley Sans";
  src: url("/fonts/valley-sans-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}

:root {
  color-scheme: dark light;
  --text: light-dark(#1f1f1f, #e8e6e1);
  --muted: light-dark(#6b6b6b, #9a9893);
  --bg: light-dark(#fdfdfb, #161615);
  --accent: light-dark(#00796b, #4db6ac);
  --accent-deco: light-dark(#009688, #26a69a);
  --rule: light-dark(#e4e4e0, #2e2e2c);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

html { scrollbar-gutter: stable; }

/* Reading column: body is the container, no wrapper */
body {
  max-inline-size: 39rem; /* ~75 characters per line */
  margin-block: 0;
  margin-inline: auto;
  padding-block: 2rem 4rem;
  padding-inline: 1rem;
  background: var(--bg);
  color: var(--text);
  font: 1.125rem/1.65 "Valley Sans", system-ui, sans-serif;
  overflow-wrap: anywhere; /* long URLs wrap instead of overflowing */
}

a { color: var(--accent); }

img, video { display: block; max-inline-size: 100%; block-size: auto; }

/* Avatar: the margin keeps the outline inside the column */
main > img {
  margin-inline-start: 8px;
  margin-block-end: clamp(1.25rem, 0.25rem + 5vw, 2rem);
  border-radius: 50%;
  outline: 8px solid var(--rule);
}

h1, h2, h3 { line-height: 1.25; margin-block: 2em 0.5em; }
h1 { font-size: 1.6rem; margin-block-start: 0; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

article header { margin-block-end: 2.5rem; }
article header p { color: var(--muted); font-size: 0.9rem; }
article header a { color: inherit; }

blockquote { margin-block: 1.5em; margin-inline: 0; padding-inline-start: 1em; border-inline-start: 3px solid var(--accent-deco); }
blockquote p:last-child { color: var(--muted); font-size: 0.9rem; }

hr { border: 0; border-block-start: 1px solid var(--rule); margin-block: 3em; }
code { font-size: 0.9em; }
pre { overflow-x: auto; padding: 1em; background: var(--rule); }

body > header, body > footer { color: var(--muted); font-size: 0.9rem; }
/* Footer: menu on the left, social icons on the right, like the header; wraps on narrow screens */
body > footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; margin-block-start: 5rem; padding-block-start: 1.5rem; border-block-start: 1px solid var(--rule); }
body > footer a { color: inherit; text-decoration: none; }

/* Header: the whole nav moves under the name when space runs out */
body > header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem 1rem;
  margin-block-end: clamp(2rem, 1rem + 5vw, 4rem);
}
/* Home has no name link: the nav is alone and stays on the right */
body > header > nav:first-child { margin-inline-start: auto; }
body > header a {
  color: var(--text);
  text-decoration: none;
}
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; }
nav a { padding-block: 0.25rem; } /* ~32px tall touch target */
nav a:hover,
body > header > a:hover { text-decoration: underline; }

nav a[aria-current] { text-decoration: none; }

/* 32px touch target, like the nav links: the padding widens the click area,
   the negative margin cancels it visually so the icon sits where the gap puts it.
   No display change here: it would override the hidden attribute */
.theme { min-block-size: 2rem; padding-block: 0; padding-inline: 0.5rem; margin-inline: -0.5rem; background: none; border: 0; font: inherit; color: var(--text); cursor: pointer; }
.theme svg { display: block; width: 1.1em; height: 1.1em; }

/* Home: the name is a small label, the tagline right below is the visual title */
main > h1:has(+ p) { font-size: 1.25rem; }

main > h1 + p {
  font-size: clamp(1.5rem, 1rem + 2.5vw, 2rem);
  line-height: 1.3;
  text-wrap: pretty;
  margin-block-start: 0;
}

.post-list { list-style: none; padding: 0; }
.post-list li { display: flex; align-items: baseline; gap: 0.5rem; margin-block-end: 0.5rem; }
.post-list time { margin-inline-start: auto; flex-shrink: 0; color: var(--muted); font-size: 0.9rem; }

.project-list { list-style: none; padding: 0; }
/* Years on the left; title (+ language badge), then description, on the right */
.project-list li {
  display: grid;
  grid-template-columns: max-content auto 1fr;
  column-gap: 0.5rem;
  align-items: baseline;
  justify-items: start;
  margin-block-end: 1.5rem;
}
/* 11ch = the longest value, "2021 - 2024": same width on every row, so titles stay aligned */
.project-list small { grid-row: span 2; min-inline-size: 11ch; color: var(--muted); font-size: 0.8rem; font-variant-numeric: tabular-nums; }
/* Without years (home), no grid: title and badge on one line, description below */
.project-list li:not(:has(small)) { display: block; }
.project-list p { grid-column: 2 / -1; margin-block: 0; color: var(--muted); font-size: 0.9rem; }

.lang-badge {
  padding-inline: 0.3em;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--muted);
  font-size: 0.7rem;
}

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; font-size: 0.9rem; }
.tags a { color: var(--muted); }

dt { margin-block-start: 1rem; }
dt:first-child { margin-block-start: 0; }
dd { margin: 0; color: var(--muted); }

main > blockquote > dl:first-of-type dt a { 
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-decoration: none;
}
main > blockquote > dl:first-of-type dt a:hover { text-decoration: underline; }

/* Simple Icons logos have no color of their own: they take the link's.
   Fixed size in rem: detailed logos get lost at the footer's smaller font size */
.social svg, .social-list svg { display: block; width: 1.25rem; height: 1.25rem; fill: currentColor; }

/* Contact page: one network per line, icon then name */
.social-list { list-style: none; padding-inline-start: 0; }
.social-list a { display: inline-flex; align-items: center; gap: 0.5rem; padding-block: 0.25rem; }