@import url('https://fonts.cdnfonts.com/css/jetbrains-mono-2');

:root {
  --font-family: "JetBrains Mono", monospace;
  --background-color: #ffffff;
  --text-color: #000000;
  --line-height: 1.20rem;
  --font-weight-normal: 500;
  --font-weight-medium: 600;
  --font-weight-bold: 800;
  --border-thickness: 2px;
  font-family: var(--font-family);
  font-weight: var(--font-weight-normal);
  font-style: normal;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html {
  display: flex;
  width: 100%;
  margin: 0;
  padding: 0;
  flex-direction: column;
  align-items: center;
  background: var(--background-color);
  color: var(--text-color);
}

body {
  position: relative;
  width: 100%;
  margin: 0;
  padding: var(--line-height) 2ch;
  max-width: calc(min(100ch, round(down, 100%, 1ch)));
  line-height: var(--line-height);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  margin: calc(var(--line-height) * 2) 0 var(--line-height);
  line-height: var(--line-height);
}

h1 {
  font-size: 2rem;
  line-height: calc(2 * var(--line-height));
  margin-bottom: calc(var(--line-height) * 2);
  text-transform: uppercase;
}

h2 {
  font-size: 1rem;
  text-transform: uppercase;
}

a {
  text-decoration-thickness: var(--border-thickness);
}

a:link, a:visited {
  color: var(--text-color);
}

time {
  white-space: pre;
}

.header {
  max-width: 100vw;
  position: relative;
  top: calc(var(--line-height) / 2);
  width: calc(round(down, 100%, 1ch) + (var(--border-thickness) * 2));
  margin: 0 calc(-1 * var(--border-thickness)) 1ch;
  display: grid;
  grid-template-areas:
    "title metadata metadata"
    "title metadata metadata"
    "author-license metadata metadata";
  grid-template-columns: 1fr auto auto;
}

.header > div {
  border: var(--border-thickness) solid var(--text-color);
  padding: calc((var(--line-height) / 2))
          calc(1ch - var(--border-thickness) / 2)
          calc((var(--line-height) / 2) - (var(--border-thickness)));
}

.title-area {
  grid-area: title;
  border-right: none !important;
}

.title-area h1 {
  margin: 0;
}

.metadata { grid-area: metadata; display: grid; grid-template-columns: auto min-content;

padding: 0 !important; }

.metadata-item { display: contents; }

.metadata .label, .metadata .value { padding: calc((var(--line-height) / 2)) calc(1ch - var(--border-thickness) / 2) calc((var(--line-height) / 2) - (var(--border-thickness))); border-left: var(--border-thickness) solid var(--text-color); border-bottom: var(--border-thickness) solid var(--text-color); }

.metadata-item :first-child.label { border-left: none; }

.metadata .label { font-weight: var(--font-weight-bold); }

.metadata .value { text-align: right; min-width: max-content; }

.metadata-item:last-child .label {
    border-bottom: none;
}
.metadata-item:last-child .value {
    border-bottom: none;
}


.author-license { grid-area: author-license; display: grid; grid-template-columns: auto 1fr auto auto; gap: 0; border: none !important; padding: 0 !important; }

.author-license .label, .author-license .value { border: var(--border-thickness) solid var(--text-color); border-top: none; padding: calc((var(--line-height) / 2)) calc(1ch - var(--border-thickness) / 2) calc((var(--line-height) / 2) - (var(--border-thickness))); }

.author-license .label {
    font-weight: var(--font-weight-bold);
    min-width: max-content;
    border-left: none;
}

.author-license .value { border-left: none; }

.author-license :first-child.label { border-left: var(--border-thickness) solid var(--text-color); }

.author-license :last-child.value { border-right: none; }

.navigation {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--border-thickness);
  width: calc(round(down, 100%, 1ch) + (var(--border-thickness) * 2));
  margin-left: calc(-1 * var(--border-thickness));
  margin-top: 2ch;
}

.navigation a {
  text-align: center;
  text-decoration: none;
  border: var(--border-thickness) solid var(--text-color);
  padding: calc((var(--line-height) / 2))
          calc(1ch - var(--border-thickness) / 2)
          calc((var(--line-height) / 2) - (var(--border-thickness)));
  display: block;
}

.navigation a:hover {
  background-color: var(--text-color);
  color: var(--background-color);
  outline: var(--border-thickness) solid var(--background-color);
}

@media screen and (max-width: 480px) {
  :root {
    font-size: 14px;
  }
  
  body {
    padding: var(--line-height) 1ch;
  }
  
  .navigation {
    width: calc(100% + (var(--border-thickness) * 2));
    margin-left: calc(-1 * var(--border-thickness));
  }
}
