@import url("https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,400;0,500;0,700;1,400&display=swap");

:root {
  --lightgray: #e0e0e0;
  --gray: #c0c0c0;
  --darkgray: #473341;
  --navy: #17050f;
  --white: #fff;
  --pink: #fd9fa9;
  --blue: #504dfa;
  /* --lightblue: #cee5fc; */
  --lightblue: #fff;
  --vinous: #c7606c;
  --plum: #a46faf;
  --liliac: #a58dfd;
  /* --liliac: #d41dbfa2; */
  /* --liliac: #d41dbf66; */
  --greenish: #dfecd8;
}

* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
  font-family: Raleway, system-ui, sans-serif;
  color: var(--darkgray);
  background-color: var(--white);
  font-size: 18px;
  min-height: 100vh;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-content: flex-start;
}

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

article {
  max-width: 40em;
  /* 600px /16 */
}

.news {
  max-width: 100%;
}

img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  object-fit: contain;
}

p,
.tmpl-post li,
img {
  max-width: 100%;
}

p,
.tmpl-post li {
  line-height: 1.45;
}

a[href] {
  color: var(--darkgray);
}

a[href]:visited {
  color: var(--navy);
}

main {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  margin-bottom: auto;
}

main :first-child {
  margin-top: 0;
}

header,
footer {
  width: 100%;
  align-self: flex-start;
  padding-left: 1em;
  padding-right: 1em;
}

footer {
  align-self: flex-end;
}

header {
  background-color: var(--liliac);
  color: var(--white);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;

  @media (max-width: 550px) {
    flex-direction: column;
  }
}

header a[href],
header a[href]:visited {
  color: var(--white);
  font-weight: 400;
  transition: border 100ms ease-in;
  /* border-bottom: 1px solid transparent; */
}

header a[href]:hover,
header a[href]:visited:hover {
  /* border-bottom: 1px solid var(--greenish); */
  text-decoration: none;
}

footer {
  padding-left: 2rem;
  padding-right: 2rem;
  text-align: right;
  font-size: 0.8rem;
}

section {
  margin-top: 40px;
}

table {
  margin: 1em 0;
}

table td,
table th {
  padding-right: 1em;
}

pre,
code {
  font-family: Consolas, Menlo, Monaco, "Andale Mono WT", "Andale Mono",
    "Lucida Console", "Lucida Sans Typewriter", "DejaVu Sans Mono",
    "Bitstream Vera Sans Mono", "Liberation Mono", "Nimbus Mono L",
    "Courier New", Courier, monospace;
  line-height: 1.5;
}

pre {
  line-height: 1.375;
  direction: ltr;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  -moz-tab-size: 2;
  -o-tab-size: 2;
  tab-size: 2;
  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;
  padding: 1em;
  margin: 0.5em 0;
  background-color: #f6f6f6;
}

code {
  font-family: monospace;
  white-space: pre-wrap;
}

blockquote {
  font-size: 0.9rem;
  margin: 2rem;
}

.highlight-line {
  display: block;
  padding: 0.125em 1em;
  text-decoration: none;
  /* override del, ins, mark defaults */
  color: inherit;
  /* override del, ins, mark defaults */
}

/* allow highlighting empty lines */

.highlight-line:empty:before {
  content: " ";
}

/* avoid double line breaks when using display: block; */

.highlight-line + br {
  display: none;
}

.highlight-line-isdir {
  color: #b0b0b0;
  background-color: #222;
}

.highlight-line-active {
  background-color: #444;
  background-color: hsla(0, 0%, 27%, 0.8);
}

.highlight-line-add {
  background-color: #45844b;
}

.highlight-line-remove {
  background-color: #902f2f;
}

/* Header */

.home {
  padding: 0;
  float: left;
  margin: 0;
  /* 16px /16 */
  font-size: 1em;
  /* 16px /16 */
}

.home a[href]:hover {
  border-bottom: none;
}

.home :link:not(:hover) {
  text-decoration: none;
}

/* Nav */

.nav {
  padding: 0;
  list-style: none;
  float: left;
  margin-left: 1em;
  margin-bottom: 0;
  margin-top: 0;

  @media (max-width: 550px) {
    margin-right: 0;
  }
}

.nav-item {
  display: inline-block;
  margin-right: 1em;
  margin-bottom: 0;
}

.nav-item a[href]:not(:hover) {
  text-decoration: none;
}

.nav-item-active {
  border-bottom: 1px solid var(--white);
}

/* Posts list */

.postlist {
  margin-bottom: 60px;
  padding-left: 0;
}

.postlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  row-gap: 3rem;
  column-gap: 2rem;
}

.postlist-list {
  max-width: 40rem;
  margin: 5px 0 60px 0;
  list-style: none;
  padding-left: 0;
}

.postlist-content {
  margin-bottom: 5rem;
}

.postlist-date {
  font-size: 0.8125em;
  color: var(--darkgray);
  white-space: nowrap;
  display: block;
  margin-bottom: 0.5rem;
}

.postlist-date {
  word-spacing: -0.5px;
}

.postlist-link {
  display: inline-block;
  text-decoration: none;
}

.postlist-link:hover {
  text-decoration: underline;
}

.postlist-item {
  text-decoration: none;
  background-color: var(--lightblue);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: background-color 200ms ease-in;
  border: 1px solid transparent;
}

.postlist-item:hover {
  text-decoration: underline;
}

.postlist-title {
  font-size: 1.2em;
  color: var(--darkgray);
}

.postlist-item-active .postlist-link {
  font-weight: bold;
}

.postlist-link {
  font-size: 1.1875em;
  /* 19px /16 */
  font-weight: 700;
}

.postslist-card img {
  display: none;
}

.postslist-card {
  padding-bottom: 1em;
  border-bottom: 2px solid var(--liliac);
  margin-left: -2em;
  margin-right: -2em;
  padding-left: 2em;

  @media (max-width: 500px) {
    margin-left: -0.5em;
    margin-right: -0.5em;
    padding-left: 0.5em;
  }
}

.tmpl-home,
.tmpl-post {
  background-color: var(--lightblue);
  margin: 0;
  width: 100%;
  flex-grow: 1;
  padding: 2em;

  @media (max-width: 550px) {
    padding: 0.5em;
  }
}

/* Tags */

.tags {
  display: flex;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  align-self: flex-start;
  vertical-align: text-top;
  font-size: 0.625em;
  cursor: pointer;
  box-shadow: none;
  border: none;
  /* 10px /16 */
  padding: 2px 4px;
  /* 8px /10 */
  background-color: var(--liliac);
  color: var(--white);
  border-radius: 0.25em;
  /* 3px /12 */
  text-decoration: none;
}

a {
  color: #3740ff;
  word-wrap: break-word;
}

a[href].tag,
a[href].tag:visited {
  color: #fff;
}

/* Warning */

.warning {
  background-color: #ffc;
  padding: 1em 0.625em;
  /* 16px 10px /16 */
}

.warning ol:only-child {
  margin: 0;
}

/* Direct Links / Markdown Headers */

.direct-link {
  font-family: sans-serif;
  text-decoration: none;
  font-style: normal;
  margin-left: 0.1em;
}

.about-page img {
  width: 100%;
  max-width: 500px;
}

section img {
  width: 100%;
}

article img {
  margin-top: 20px;
}

small img {
  max-height: 18rem;
}

small {
  color: #6f6f7b;
}

.img-small {
  max-width: 200px;
}

.img-medium {
  max-width: 400px;
}

.img-wide {
  max-width: 600px;
}

.img-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 2em;
  margin-top: 1em;
}

.img-wrap img {
  max-width: 19em;
  margin: 0;
}

.img-vertical-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
}

.img-vertical {
  max-height: 500px;
  object-fit: contain;
  object-position: left;
  max-width: 300px;
  margin: 0;
}

footer {
  display: flex;
  justify-content: space-between;
  background-color: var(--liliac);
  color: var(--greenish);
}

footer a[href],
footer a[href]:visited {
  color: var(--white);
  font-weight: 400;
  text-decoration: none;
  transition: border 100ms ease-in;
  border-bottom: 1px solid var(--greenish);
}

footer a[href]:hover,
footer a[href]:visited:hover {
  border-bottom: 1px solid transparent;
}

@media (max-width: 500px) {
  .home {
    float: none;
  }

  .nav {
    display: flex;
    flex-direction: column;
    margin: 8px 0 0 0;
    gap: 8px;
  }

  .postlist-list {
    padding-left: 0;
    list-style: none;
  }

  footer {
    flex-direction: column;
  }
}

summary {
  cursor: pointer;
}

li {
  line-height: 1.45;
  margin-bottom: 10px;
}


/* ========================================
   CV PAGE
   ======================================== */

.cv {
  --cv-accent: var(--liliac);
  --cv-accent-dark: var(--plum);
  --cv-text: var(--darkgray);
  --cv-muted: #77717a;
  --cv-border: #e9e3eb;
  --cv-surface: #faf8fb;

  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
  color: var(--cv-text);
  font-size: 16px;
  line-height: 1.7;
}

/* Header */

.cv .cv__header {
  display: block;
  width: 100%;
  padding: 2.5rem 0 2rem;
  margin-bottom: 3rem;
  background: transparent;
  color: var(--cv-text);
  border-bottom: 2px solid var(--cv-accent);
}

.cv__header h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.045em;
}

.cv .cv__headline {
  margin: 0 0 0.5rem;
  color: var(--cv-accent-dark);
  font-size: 1.35rem;
  font-weight: 500;
}

.cv__header > p:not(.cv__headline) {
  margin: 0;
  color: var(--cv-muted);
}

.cv__contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.cv .cv__contacts a,
.cv .cv__contacts a:visited {
  color: var(--cv-accent-dark);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--cv-accent);
  transition: color 150ms ease, border-color 150ms ease;
}

.cv .cv__contacts a:hover {
  color: var(--cv-text);
  border-color: var(--cv-text);
}

/* Sections */

.cv > section {
  margin-top: 3.5rem;
}

.cv > section > h2 {
  margin: 0 0 1.75rem;
  padding-bottom: 0.7rem;
  font-size: 1.65rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
  border-bottom: 1px solid var(--cv-border);
}

.cv p {
  max-width: 100%;
  margin: 0 0 0.9rem;
  line-height: 1.75;
}

.cv > section:first-of-type p {
  max-width: 75ch;
}

/* Experience */

.cv article {
  max-width: 100%;
  margin: 0 0 2rem;
  padding: 0 0 2rem;
  border-bottom: 1px solid var(--cv-border);
}

.cv article:last-child {
  border-bottom: none;
}

.cv article > h3 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  line-height: 1.4;
  font-weight: 700;
}

.cv article > p:first-of-type {
  margin-bottom: 0.8rem;
  color: var(--cv-accent-dark);
  font-size: 0.95rem;
  font-weight: 600;
}

.cv article > p:not(:first-of-type) {
  color: var(--cv-muted);
}

.cv article ul {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
}

.cv article li {
  margin-bottom: 0.65rem;
  padding-left: 0.2rem;
  line-height: 1.7;
}

.cv article li::marker {
  color: var(--cv-accent-dark);
}

/* Selected projects */

.cv article > h4 {
  margin: 1.5rem 0 1rem;
  font-size: 1rem;
  color: var(--cv-accent-dark);
}

.cv article > h5 {
  margin: 1.5rem 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
}

.cv article > h5 + p {
  color: var(--cv-muted);
  font-size: 0.95rem;
}

/* Technical skills */

.cv > section:nth-of-type(3) > h3 {
  display: inline-block;
  margin: 1.1rem 0 0.35rem;
  color: var(--cv-accent-dark);
  font-size: 0.95rem;
  font-weight: 700;
}

.cv > section:nth-of-type(3) > p {
  margin: 0;
  color: var(--cv-text);
  line-height: 1.8;
}

/* Education */

.cv > section:last-of-type h3 {
  margin: 0 0 0.35rem;
  font-size: 1.1rem;
}

.cv > section:last-of-type p {
  color: var(--cv-muted);
}

/* Links and selection */

.cv a:focus-visible {
  outline: 2px solid var(--cv-accent-dark);
  outline-offset: 4px;
}

/* Responsive */

@media (max-width: 600px) {
  .cv {
    padding: 1.5rem 1.1rem 3rem;
    font-size: 15px;
  }

  .cv .cv__header {
    padding: 1.5rem 0;
    margin-bottom: 2rem;
  }

  .cv > section {
    margin-top: 2.5rem;
  }

  .cv > section > h2 {
    font-size: 1.4rem;
  }

  .cv article {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
  }
}

/* Print / PDF */

@media print {
  .cv {
    max-width: none;
    padding: 0;
    font-size: 10pt;
  }

  .cv .cv__header {
    padding-top: 0;
  }

  .cv > section {
    margin-top: 1.5rem;
  }

  .cv article {
    break-inside: avoid;
  }

  .cv a {
    color: inherit !important;
    text-decoration: none;
  }
}
