/**
 * Adapted from the-monospace-web by Oskar Wickström (MIT License)
 * https://github.com/owickstrom/the-monospace-web
 */
@import url('https://fonts.cdnfonts.com/css/jetbrains-mono-2');

/* Reset (merged from Monospace Web reset.css) */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}

body {
  line-height: 1;
}

ol, ul {
  list-style: none;
}

blockquote, q {
  quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

:root {
  --font-family: "JetBrains Mono", monospace;
  --line-height: 1.20rem;
  --border-thickness: 2px;
  --text-color: #00ff33;
  --text-color-alt: #046e27;
  --background-color: #000;
  --background-color-alt: #0a1a0a;

  --font-weight-normal: 500;
  --font-weight-medium: 600;
  --font-weight-bold: 800;

  font-family: var(--font-family);
  font-optical-sizing: auto;
  font-weight: var(--font-weight-normal);
  font-style: normal;
  font-variant-numeric: tabular-nums lining-nums;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

* + * {
  margin-top: var(--line-height);
}

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(80ch, round(down, 100%, 1ch)));
  line-height: var(--line-height);
  overflow-x: hidden;
}

@media screen and (max-width: 480px) {
  :root {
    font-size: 14px;
  }
  body {
    padding: var(--line-height) 1ch;
  }
}

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;
}

hr {
  position: relative;
  display: block;
  height: var(--line-height);
  margin: calc(var(--line-height) * 1.5) 0;
  border: none;
  color: var(--text-color);
}

hr:after {
  display: block;
  content: "";
  position: absolute;
  top: calc(var(--line-height) / 2 - var(--border-thickness));
  left: 0;
  width: 100%;
  border-top: calc(var(--border-thickness) * 3) double var(--text-color);
  height: 0;
}

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

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

p {
  margin-bottom: var(--line-height);
  word-break: break-word;
  word-wrap: break-word;
  hyphens: auto;
}

strong {
  font-weight: var(--font-weight-bold);
}

em {
  font-style: italic;
}

sub {
  position: relative;
  display: inline-block;
  margin: 0;
  vertical-align: sub;
  line-height: 0;
  width: calc(1ch / 0.75);
  font-size: .75rem;
}

table {
  position: relative;
  top: calc(var(--line-height) / 2);
  width: calc(round(down, 100%, 1ch));
  border-collapse: collapse;
  margin: 0 0 calc(var(--line-height) * 2);
}

th, td {
  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)));
  line-height: var(--line-height);
  vertical-align: top;
  text-align: left;
}

table tbody tr:first-child > * {
  padding-top: calc((var(--line-height) / 2) - var(--border-thickness));
}

th {
  font-weight: 700;
}

.width-min {
  width: 0%;
}

.width-auto {
  width: 100%;
}

.header {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  grid-template-rows: auto auto auto;
  width: calc(round(down, 100%, 1ch));
  position: relative;
  top: calc(var(--line-height) / 2);
  margin: 0 0 calc(var(--line-height) * 2);
  border-top: var(--border-thickness) solid var(--text-color);
  border-left: var(--border-thickness) solid var(--text-color);
}

.header > * {
  margin-top: 0;
}

.header-brand,
.header-cell {
  border-right: var(--border-thickness) solid var(--text-color);
  border-bottom: 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)));
  line-height: var(--line-height);
  vertical-align: top;
  text-align: left;
}

.header-brand {
  grid-column: 1 / 3;
  grid-row: 1 / 3;
}

.header-cell:nth-child(2) { grid-row: 1; grid-column: 3; }
.header-cell:nth-child(3) { grid-row: 1; grid-column: 4; }
.header-cell:nth-child(4) { grid-row: 2; grid-column: 3; }
.header-cell:nth-child(5) { grid-row: 2; grid-column: 4; }
.header-cell:nth-child(6) { grid-row: 3; grid-column: 1; }
.header-cell:nth-child(7) { grid-row: 3; grid-column: 2; }
.header-cell:nth-child(8) { grid-row: 3; grid-column: 3; }
.header-cell:nth-child(9) { grid-row: 3; grid-column: 4; }

.header-label {
  font-weight: 700;
}

.header-cell:nth-child(3),
.header-cell:nth-child(5),
.header-cell:nth-child(9) {
  text-align: right;
}

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

.header .subtitle {
  display: block;
}

@media screen and (max-width: 640px) {
  .header {
    display: flex;
    flex-wrap: wrap;
  }

  .header-brand {
    flex: 1 0 100%;
  }

  .header-cell {
    flex: 1 0 calc(50% - var(--border-thickness));
    min-width: 0;
  }

  .header h1 {
    font-size: 1.25rem;
  }
}

img, video {
  display: block;
  width: 100%;
  object-fit: contain;
  overflow: hidden;
}

img {
  font-style: italic;
  color: var(--text-color-alt);
}

details {
  border: var(--border-thickness) solid var(--text-color);
  padding: calc(var(--line-height) - var(--border-thickness)) 1ch;
  margin-bottom: var(--line-height);
}

summary {
  font-weight: var(--font-weight-medium);
  cursor: pointer;
}

details[open] summary {
  margin-bottom: var(--line-height);
}

details ::marker {
  display: inline-block;
  content: '▶';
  margin: 0;
}

details[open] ::marker {
  content: '▼';
}

details :last-child {
  margin-bottom: 0;
}

pre {
  white-space: pre;
  overflow-x: auto;
  margin: var(--line-height) 0;
  overflow-y: hidden;
}

figure pre {
  margin: 0;
}

pre, code {
  font-family: var(--font-family);
}

code {
  font-weight: var(--font-weight-medium);
}

figure {
  margin: calc(var(--line-height) * 2) 3ch;
  overflow-x: auto;
  overflow-y: hidden;
}

figcaption {
  display: block;
  font-style: italic;
  margin-top: var(--line-height);
}

ul, ol {
  padding: 0;
  margin: 0 0 var(--line-height);
}

ul {
  list-style-type: square;
  padding: 0 0 0 2ch;
}

ol {
  list-style-type: none;
  counter-reset: item;
  padding: 0;
}

ol ul,
ol ol,
ul ol,
ul ul {
  padding: 0 0 0 3ch;
  margin: 0;
}

ol li:before {
  content: counters(item, ".") ". ";
  counter-increment: item;
  font-weight: var(--font-weight-medium);
}

li {
  margin: 0;
  padding: 0;
}

li::marker {
  line-height: 0;
}

::-webkit-scrollbar {
  height: var(--line-height);
}

footer {
  color: var(--text-color-alt);
  font-size: 0.875rem;
}

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

.fkeys {
  display: none;
}

.fkeys:not([hidden]) {
  display: block;
}

.fn {
  color: var(--text-color-alt);
}

@media screen and (max-width: 640px) {
  .fkeys {
    display: none !important;
  }
}

/* CV page layout */
body.cv-page {
  max-width: none;
  padding: var(--line-height) 2ch 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

body.cv-page .header {
  flex-shrink: 0;
  margin-bottom: var(--line-height);
}

body.cv-page nav {
  flex-shrink: 0;
  margin-bottom: var(--line-height);
}

body.cv-page .pdf-viewer {
  flex: 1;
  min-height: 0;
  margin-top: 0;
}

body.cv-page .pdf-viewer embed {
  display: block;
  width: 100%;
  height: 100%;
  border: var(--border-thickness) solid var(--text-color);
}

@media screen and (max-width: 480px) {
  body.cv-page {
    padding: var(--line-height) 1ch 0;
  }
}
