:root {
  --width: 34.5;
  --rounding: 4px;
  --accent: #696;
  --dark-grey: #ddd;
  --grey: #eee;
  --light-grey: #f8f8f8;
}

@font-face {
  font-family: 'Proza';
  font-weight: 400;
  src: url('/proza-regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Proza';
  font-weight: 300;
  src: url('/proza-light.woff2') format('woff2');
}

@font-face {
  font-family: 'Proza';
  font-weight: 300;
  font-style: italic;
  src: url('/proza-light-italic.woff2') format('woff2');
}

*,
::before,
::after {
  box-sizing: border-box;
  margin: 0;
}

html {
  height: 100%;
  font-family: Proza,sans-serif;
  font-weight: 300;
  font-size: clamp(18px, 100vw / var(--width), 20px);
  font-feature-settings: 'onum','pnum';
  line-height: 1.5;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

body {
  display: grid;
  grid-template-rows: max-content 1fr max-content;
  height: 100%;
}

header {
  padding: 1.25rem 0 0.5rem;
}

header nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-auto-flow: dense;
  gap: 0.25rem;
  align-items: center;
}

header nav > a {
  grid-column: 2;
  display: grid;
  place-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #000;
  transition: background-color 0.2s;
}

header nav > a.section,
header nav > a:hover {
  background: var(--accent);
}

header nav svg {
  height: 1.6rem;
  fill: #fff;
}

header nav div,
footer nav {
  display: grid;
  grid-auto-flow: column;
  justify-content: center;
}

header nav div {
  justify-content: right;
}

header nav div + div {
  justify-content: left;
}

nav a {
  display: block;
  position: relative;
  padding: 0.2rem 0.75rem 0.3rem;
  border-radius: 1rem;
  color: inherit;
  font-weight: 400;
  font-variant: small-caps;
  text-transform: lowercase;
  text-decoration: none;
  transition: color 0.2s;
}

nav a.section,
nav a:hover {
  color: var(--accent);
}

nav a + a::after {
  content: '';
  display: block;
  position: absolute;
  top: 0.85rem;
  left: -0.175rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: var(--accent);
}

footer {
  padding: 3rem 0 1.5rem;
  text-align: center;
}

footer div {
  padding: 1rem 1.25rem 0.25rem;
}

footer span {
  white-space: nowrap;
}

h1,
h2,
h3,
p,
dl,
ol,
ul,
figure,
form,
main > div {
  max-width: calc(1rem * var(--width));
  margin: 0 auto;
  padding: 1rem 1.25rem 0;
}

p:has(img),
figure,
form,
.highlight {
  padding: 1.25rem 1.25rem 0.25rem;
}

h1,
h2,
h3 {
  font-weight: 400;
  line-height: 1.1;
}

h1 {
  font-size: 2rem;
  text-align: center;
  text-wrap: balance;
}

h2 {
  padding-top: 2rem;
  font-size: 1.5rem;
}

h3 {
  padding-top: 2rem;
  font-size: 1.1rem;
}

dl {
  padding: 0 2.25rem;
}

dt {
  padding-top: 1rem;
}

ol,
ul {
  padding: 1rem 1.25rem 0 2.75rem;
}

:is(ol,ul) :is(ol,ul) {
  padding: 0 0 0 1rem;
}

figure,
form {
  max-width: max-content;
}

figure > img,
figure > svg {
  max-width: calc(100vw - 2.5rem);
  height: auto;
}

form > div {
  padding: 1rem;
  border-radius: var(--rounding);
  background: var(--grey);
}

.scroll {
  width: 100vw;
  overflow-x: auto;
}

table {
  margin: -0.25rem auto 0.25rem;
  border-collapse: collapse;
  font-feature-settings: 'lnum','tnum';
}

table:has(tr:nth-child(even):last-child) {
  margin-bottom: 0;
}

:not(.scroll) > table > thead {
  position: sticky;
  top: 0;
  background: var(--light-grey);
}

th,
td {
  background: #fff linear-gradient(var(--grey),var(--grey)) bottom/100% 2px no-repeat;
  padding: 0.25rem 0.5rem calc(0.25rem + 2px);
}

th {
  font-weight: 400;
  text-align: left;
}

:nth-child(odd) > td {
  background-color: var(--light-grey);
}

:nth-child(even):last-child > td {
  background-image: none;
  padding-bottom: 0;
}

.numeric {
  text-align: right;
}

.negative {
  color: #f00;
}

pre,
code {
  font: 0.8rem/1.2rem 'Consolas',Menlo,monospace;
  font-feature-settings: 'lnum','tnum';
}

a {
  color: var(--accent);
  text-decoration-color: transparent;
  text-decoration-thickness: 0.1em;
  text-underline-offset: 0.15em;
  transition: text-decoration-color 0.2s;
}

a:hover {
  text-decoration-color: var(--accent);
}

abbr {
  font-variant: small-caps;
  text-transform: lowercase;
}

code {
  padding: 4px 6px 2px;
  border-radius: var(--rounding);
  background: var(--grey);
}

sub,
sup {
  vertical-align: baseline;
  font-variant-position: sub;
}

sup {
  font-variant-position: super;
}

img,
svg {
  vertical-align: bottom;
}

img {
  max-width: 100%;
  height: auto;
}

input,
output,
textarea,
select {
  border: 2px solid var(--dark-grey);
  border-radius: var(--rounding);
  background: #fff no-repeat center center;
  color: #000;
}

:is(input, textarea, select):where(:active:not(:disabled), :focus) {
  border-color: var(--accent);
  outline: none;
}

:is(input, textarea, select):disabled,
output {
  background: var(--grey);
  color: #000;
}

input:where([type="password"], [type="text"]),
output,
textarea,
select {
  padding: calc(0.25rem - 2px) calc(0.5rem - 2px);
  font: 300 1rem/1.5 Proza,sans-serif;
  font-feature-settings: 'lnum','tnum';
}

input:where([inputmode="numeric"], [inputmode="decimal"]),
output {
  text-align: right;
}

input:where([type="checkbox"], [type="radio"]) {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  vertical-align: top;
  margin: calc(0.75rem - 11px) 0.25rem 0 0;
}

input[type="checkbox"]:checked {
  background-image: url('/checkbox.svg');
}

input[type="radio"] {
  border-radius: 50%;
}

input[type="radio"]:checked {
  background-image: url('/radio.svg');
}

input[type="file"] {
  position: absolute;
  left: -100vw;
}

output{
  display: inline-block;
}

select {
  -webkit-appearance: none;
  appearance: none;
  height: 2rem;
  padding-right: 30px;
  background-image: url('/select.svg');
  background-position: right;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

button:-moz-focus-inner {
  padding: 0;
  border: 0;
}

button:where(:active, :focus) {
  outline: none;
}

button > span,
.button {
  display: inline-block;
  padding: 0 0.5rem;
  border: 2px solid var(--accent);
  border-radius: calc(0.75rem + 2px);
  background: var(--accent);
  color: #fff;
  font-weight: 400;
  -webkit-user-select: none;
  user-select: none;
  cursor: pointer;
}

button:where(:active, :focus) > span,
.button:where(:active, :focus),
input[type="file"]:where(:active, :focus) + .button {
  background: #fff;
  color: var(--accent);
}

main > div > pre,
.highlight > div {
  border: 2px solid var(--grey);
  border-radius: var(--rounding);
}

.highlight table {
  width: 100%;
  margin: 0;
}

.highlight tr {
  display: grid;
  grid-template-columns: max-content 1fr;
}

main > div > pre,
.highlight td {
  overflow: auto;
  padding: 0.35rem 0.6rem;
  background: transparent;
}

.highlight td:first-child {
  overflow: visible;
  color: #aaa;
}

.highlight td:last-child {
  padding-left: 0;
}

.highlight code {
  padding: 0;
  background: transparent;
}

.highlight :where(.c, .c1, .cm, .sd) {
  color: #aaa;
  font-style: italic;
}

.highlight :where(.o, .p) {
  color: #aaa;
}

.highlight :where(.fm, .k, .kc, .kd, .nt),
.highlight .language-css :where(.nc, .nd, .nn, .s2) {
  color: #c66;
}

.highlight :where(.na, .nb, .nf, .nv),
.highlight .language-css :where(.k, .kc, .kp, .kt),
.highlight .language-javascript .nx {
  color: #5b5;
}

.highlight :where(.cp, .nc, .ni, .nx),
.highlight .language-css :where(.n, .nv) {
  color: #e94;
}

.highlight :where(.m, .mf, .mh, .mi, .s, .s1, .s2, .sr) {
  color: #36b;
}

.home {
  align-self: center;
}

.home + footer {
  padding-top: 1rem;
}

.home p {
  max-width: 24.5rem;
  text-align: center;
}

p:has(+ .gallery) {
  text-align: center;
}

.gallery {
  --columns: 6;
  --gap: 3rem;
  display: grid;
  grid-template-columns: repeat(var(--columns), 1fr);
  gap: var(--gap);
  max-width: 2340px;
  padding: var(--gap) var(--gap) 0;
  text-align: center;
}

@media screen and (max-width:1960px) {
  .gallery {
    --columns: 5;
  }
}

@media screen and (max-width:1580px) {
  .gallery {
    --columns: 4;
  }
}

@media screen and (max-width:1200px) {
  .gallery {
    --columns: 3;
  }
}

@media screen and (max-width: 820px) {
  .gallery {
    --columns: 2;
    --gap: calc(8vw - 6px);
  }
}

.gallery img {
  margin-bottom: max(0.5rem, calc(var(--gap) / 4));
}

@media print {
  header, footer {
    display: none;
  }
}
