/* silachev.com. The design is frame "02 — One paragraph (letter)" in the Pencil file silachev-com.pen. */

@font-face {
  font-family: "Source Serif 4";
  src: url("fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fbf9f4;
  --ink: #161616;
  --link: #065580;
  --link-line: rgba(6, 85, 128, 0.22);
  --hover: #e20016;

  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;

  --size: clamp(24px, 1rem + 2.2vw, 44px); /* 44 px on desktop, about 25 px on a phone */
  --side: clamp(24px, 18vw - 60px, 200px);
  --top: clamp(64px, 11.7vw, 168px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.page {
  max-width: 1440px;
  margin: 0 auto;
  padding: var(--top) var(--side);
}

/* The letter: one paragraph, links underlined below the descenders */

.letter {
  max-width: 21em;
  font: 400 var(--size) / 1.3 var(--serif);
}

.letter p {
  margin: 0;
  text-wrap: pretty;
}

.letter p + p {
  margin-top: 1em;
}

.letter a {
  color: var(--link);
  text-decoration: none;
}

.letter a .text {
  border-bottom: 2px solid var(--link-line);
}

.letter a:hover {
  color: var(--hover);
}

.letter a:hover .text {
  border-bottom-color: color-mix(in srgb, var(--hover) 35%, transparent);
}

.letter a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 4px;
  border-radius: 3px;
}

.project {
  white-space: nowrap;
}

.project img {
  width: 0.82em;
  height: 0.82em;
  margin: 0 0.27em 0 0.05em;
  vertical-align: -0.1em;
}

@media (max-width: 759px) {
  .letter a .text {
    border-bottom-width: 1.5px;
  }
}
