/* Colors and type follow city-roads and peak-map. */
:root {
  --page: #ffffff;
  --ink: #434343;
  --strong: #212121;
  --muted: #6b6b6b;
  --rule: #e6e6e6;
  --highlight: #ff4081;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding: 0 clamp(1.25rem, 5vw, 3.5rem);
  background: var(--page);
  color: var(--ink);
  font-family: 'Avenir', 'Avenir Next', Helvetica, Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.intro, main, footer {
  max-width: 66rem;
  margin: 0 auto;
}

h1, h2, h3 {
  color: var(--strong);
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
}

p { margin: 0 0 1rem; max-width: 38rem; }

a {
  color: var(--strong);
  text-decoration: underline;
  text-decoration-color: var(--highlight);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { text-decoration-thickness: 3px; }
a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--highlight);
  outline-offset: 3px;
}

/* Intro */

.intro {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: start;
  padding: clamp(2.5rem, 8vw, 5.5rem) 0 1rem;
}
.portrait {
  width: 7.5rem;
  height: 7.5rem;
  border-radius: 50%;
  border: 1px solid var(--rule);
}
h1 {
  font-size: clamp(2.25rem, 6vw, 3.25rem);
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin-top: 1.25rem;
}
.links a { font-weight: 500; }

/* Sections */

section { padding-top: clamp(3rem, 7vw, 4.5rem); }
h2 { font-size: 1.75rem; margin-bottom: 0.5rem; }
h2 + ul { margin-top: 1.5rem; }
.note { color: var(--muted); margin-bottom: 1.75rem; }

ul { list-style: none; margin: 0; padding: 0; }

/* Projects with a screenshot */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 2.5rem 2rem;
}
.shot {
  display: block;
  border: 1px solid var(--rule);
  margin-bottom: 0.9rem;
}
.shot img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}
.shot pre {
  display: grid;
  place-content: center;
  margin: 0;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  color: var(--strong);
  font-family: Menlo, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
}
.shot { text-decoration: none; }
.shot:hover, .shot:focus-visible { border-color: var(--highlight); }
.cards h3 { font-size: 1.1875rem; margin-bottom: 0.25rem; }
.cards p { margin: 0; font-size: 1rem; line-height: 1.5; }
.cards p + p { margin-top: 0.3rem; }

.source { color: var(--muted); font-size: 0.9375rem; white-space: nowrap; }

/* Projects without a screenshot */

.rows li {
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: 0 1.5rem;
  padding: 0.55rem 0;
  border-top: 1px solid var(--rule);
  font-size: 1rem;
  line-height: 1.5;
}
.rows a:first-child { font-weight: 500; overflow-wrap: anywhere; justify-self: start; }
.rows span { min-width: 0; overflow-wrap: anywhere; }

details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary {
  cursor: pointer;
  padding: 0.9rem 0;
  color: var(--strong);
  font-weight: 500;
}
details[open] summary { color: var(--muted); }
details .rows li:first-child { border-top: 0; }

/* Footer */

footer {
  margin-top: clamp(3rem, 7vw, 4.5rem);
  padding: 1.5rem 0 3rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.9375rem;
}
footer p { margin: 0; }

@media (max-width: 40rem) {
  .intro { grid-template-columns: 1fr; gap: 1.25rem; }
  .portrait { width: 5.5rem; height: 5.5rem; }
  .rows li { grid-template-columns: 1fr; }
}
