:root {
  --color-accent: oklch(65.45% 0.088 237.01);
}

html {
  min-height: 100%;
  color-scheme: dark;
  accent-color: var(--color-accent);
}

body {
  /* Set line height to 1.5 times the font size
	   and use the OS’s UI font as the website font
	 */
  font: 100%/1.5 system-ui;
  max-width: 100ch;
  margin-inline: max(1em, (100% - 100ch) / 2);
}

h1 {
  font-size: clamp(2.75rem, 5vw, 4.5rem);
  line-height: 1.05;
  margin-block-end: 1rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.1;
  text-wrap: balance;
  margin-top: 0;
}

.projects h2 {
  margin-bottom: 0;
}

nav {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom-width: 1px;
  border-bottom-style: solid;
  --border-color: oklch(50% 10% 200 / 40%);
  border-bottom-color: var(--border-color);
}

ul, li {
  display: contents;
}

nav a {
  flex: 1;
  text-decoration: none;
  color: inherit;
  text-align: center;
  padding: 0.5em;
}

.current {
  border-width: 0.4em;
  padding-bottom: 0.35em;
  border-bottom-style: solid;
  border-bottom-color: oklch(0.53 0.12 45);
}

a:hover {
  border-width: 0.4em;
  padding-bottom: 0.35em;
  border-bottom-style: solid;
  border-bottom-color: var(--color-accent);
  background-color: color-mix(in oklch, var(--color-accent), canvas 85%);
}

form {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 1rem;
  align-items: center;
}

form label {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  gap: 0.4rem;
}

form button {
  grid-column: 1 / -1;
  width: 100%;
  padding: 0.75rem 1rem;
}

input,
textarea {
  font: inherit;
  width: 100%;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15em, 1fr));
  gap: 1em;
  margin-block: 2em;
}

.projects article {
  display: grid;
  grid-template-rows: subgrid;
  grid-row: span 3;
}

.color-scheme {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 80%;
  font-family: inherit;
}