:root {
  --purple: rgba(91, 20, 255, 1);
  --purple-secondary: rgba(192, 153, 255, 0.9);
  --purple-tertiary: rgba(192, 153, 255, 0.74);
  --orange: rgba(199, 82, 0, 1);
  --green: rgba(1, 224, 84, 1);
  --blue: rgba(4, 118, 223, 1);
  --background: rgba(255, 255, 255, 1);
  --barsuk: rgb(236, 179, 107);
  --border: rgba(0, 0, 0, 0.16);
  --border-brand: var(--barsuk);
  --border-tertiary: rgba(0, 0, 0, 0.08);
  --text-primary: rgba(0, 0, 0, 0.95);
  --text-secondary: rgba(0, 0, 0, 0.72);
  --text-tertiary: rgba(0, 0, 0, 0.52);
  --text-oncolor: rgba(255, 255, 255, 1);
}

@media (prefers-color-scheme: light) {
  :root {
    --background: rgba(255, 255, 255, 1);
    --border: rgba(0, 0, 0, 0.28);
    --border-tertiary: rgba(0, 0, 0, 0.174);
    --text-primary: rgba(0, 0, 0, 0.95);
    --text-secondary: rgba(0, 0, 0, 0.72);
    --text-tertiary: rgba(0, 0, 0, 0.52);
    --text-oncolor: rgba(255, 255, 255, 1);
    --text-oncolor-secondary: rgba(255, 255, 255, 0.8);
    --text-oncolor-tertiary: rgba(255, 255, 255, 0.52);
    --purple: rgba(91, 20, 255, 1);
    --purple-secondary: rgba(192, 153, 255, 0.9);
    --purple-tertiary: rgba(192, 153, 255, 0.74);
    --orange: rgba(200, 10, 0, 1);
    --gold: rgba(218, 165, 32, 1);
    --green: rgba(22, 115, 20, 1);
    --blue: rgba(4, 118, 223, 1);
    --blue-secondary: rgba(44, 118, 223, 0.79);
    --blue-tertiary: rgba(4, 118, 223, 0.69);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --purple: rgba(192, 153, 255, 1);
    --purple-secondary: rgba(192, 153, 255, 0.9);
    --purple-tertiary: rgba(192, 153, 255, 0.71);
    --purple-text: rgba(211, 222, 251, 0.8);
    --orange: rgba(255, 128, 0, 1);
    --green: rgba(1, 224, 84, 1);
    --blue: rgba(64, 188, 244, 1);
    --blue-secondary: rgba(64, 188, 244, 0.79);
    --blue-tertiary: rgba(64, 188, 244, 0.69);
    --fog: rgba(242, 242, 240, 1);
    --fog-secondary: rgba(142, 142, 140, 1);
    --fog-tertiary: rgba(92, 96, 99, 1);
    --gold: rgba(255, 215, 0, 1);
    --gold-glow: rgba(255, 215, 0, 0.5);
    --background: rgba(17, 21, 24, 1);
    --border: var(--fog-secondary);
    --border-tertiary: var(--fog-tertiary);
    --shadow: rgba(0, 0, 0, 0.88);
    --text-primary: var(--fog);
    --text-secondary: var(--fog-secondary);
    --text-tertiary: var(--fog-tertiary);
    --text-oncolor: rgba(255, 255, 255, 1);
  }
}

.barsuk {
  color: var(--barsuk);
}

.purple {
  color: var(--purple);
}

.orange {
  color: var(--orange);
}

.green {
  color: var(--green);
}

.blue {
  color: var(--blue);
}

.gold {
  color: var(--gold);
}

.textPrimary {
  color: var(--text-primary);
}

.textSecondary {
  color: var(--text-secondary);
}

.textTertiary {
  color: var(--text-tertiary);
}

:root {
  --typeface:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --smaller-text: 0.6rem;
  --small-text: 0.8rem;
  --normal-text: 1rem;
  --large-text: 1.25rem;
  --larger-text: 1.35rem;
  --largest-text: 2rem;
}

strong {
  font-weight: bold;
}

p {
  font-size: var(--large-text);
  line-height: 1.95rem;
  font-weight: 400;

  &:first-of-type {
    margin-top: 0;
    padding-top: 0;
  }
}

ol,
ul {
  display: block;
  margin-block-start: 1rem;
  margin-block-end: 1rem;
  padding-inline-start: 40px;

  li::marker {
    border: none;
    color: var(--text-tertiary);
    position: relative;
  }
  &.no-marker {
    list-style-type: none;
    padding-left: 0;
  }
}

ol {
  padding-left: 1.4rem;
}

ul {
  list-style: outside square;
  padding-left: 1.1rem;
}

a {
  color: var(--blue);
  text-decoration: none;

  &:hover {
    color: var(--blue);
    -webkit-text-decoration: underline solid;
            text-decoration: underline solid;
    text-decoration-thickness: 0.1rem;
  }
}

h1,
h2,
h3,
h4,
h5,
h6,
blockquote {
  text-wrap: balance;
}

h1 {
  color: var(--text-primary);
  font-size: var(--largest-text);
  line-height: 1.2em;
  font-weight: bold;
  margin-top: 1rem;
  margin-bottom: 0;
  padding-bottom: 1rem;
}

h2 {
  color: var(--text-primary);
  font-size: var(--larger-text);
  font-weight: 600;
  padding-top: 0.9rem;
  margin-bottom: 0.9rem;
  margin-block-start: 0.41em;
}

p + h2 {
  padding-top: 1.9rem;
}

h3 {
  color: var(--text-primary);
  font-size: var(--normal-text);
  line-height: var(--normal-text);
  font-weight: bold;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding-top: 1rem;
}

h2 + h3 {
  margin-top: 1.9rem;
}

small {
  color: var(--text-secondary);
  font-size: var(--small-text);
  line-height: var(--smaller-text);
  font-weight: 300;
}

/* Table formatting */

table {
  border-collapse: collapse;
  width: 100%;
}

thead {
  color: var(--text-secondary);
  text-align: left;
}

th {
  font-weight: 400;
}

th,
td {
  padding: 0.25em 1ch 0.25em 1ch;
  border: 1px solid var(--border-tertiary);
}

/* Icons */

.ascii {
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Helvetica Neue",
    Helvetica,
    Arial,
    sans-serif;
  &:hover {
    text-decoration: none;
  }
}

.col1-h2 {
  margin-top: 1.5rem;
}

.icon {
  aspect-ratio: 1 / 1;
  clip-path: url(#squircle);
  color: var(--text-oncolor);
  display: inline-block;
  font-size: 0.75rem;
  height: 18px;
  line-height: 18px;
  text-align: center;
  vertical-align: middle;

  &:first-of-type {
    margin-left: 0.5ch;
  }

  &:hover {
    color: var(--text-oncolor);
    text-decoration: none;
  }
}

.tooltip {
  background-color: var(--purple-tertiary);
  cursor: help;

  &:hover {
    background-color: var(--purple-secondary);
  }
}

.external-link {
  background-color: var(--blue-tertiary);

  &:hover {
    background-color: var(--blue-secondary);
  }
}

html {
  background-color: var(--background);
  color: var(--text-primary);
  font: 1rem/1.75rem body var(--typeface);
  font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
  font-weight: 500;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  padding-top: 3vh;
  padding-bottom: 6vh;
}

body {
  display: flex;
  height: 85dvh;
}

main {
  column-gap: 8rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: min(84vw, calc(1120px + 3rem));
  margin: auto auto;
  section {
    break-inside: avoid;
    max-width: 560px;
  }
}

@media (max-width: 756px) {
  main {
    display: initial;
  }
}

.profile {
  clip-path: url(#squircle);
}

.col-1 {
  grid-column: 1;
}

.col-2 {
  grid-column: 2;
}

header,
footer {
  line-height: 1.5em;
}

figure {
  margin: 0;
}

article {
  padding-top: 3vh;
  padding-bottom: 6vh;
}

hr {
  border: none;
  height: 2px;
  background-color: var(--border-tertiary);
  margin: 1rem 0;
  width: 33%;
}

.hero {
  border: 1px solid var(--shadow);
  margin: 1.75rem 0.25rem;
  width: 100%;
}
