@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Syne";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("/assets/fonts/syne-latin-800-normal.woff2") format("woff2");
}

:root {
  --bg: #0b0b0e;
  --text: #f2f2f5;
  --text-soft: #c3c3ce;
  --text-mute: #9a9aa8;
  --line: #454554;
  --accent: #8587ff;
  --name: #9ea0ff;
  --name-edge: #5d5fb8;
  --border: #3a3a52;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  /* size of one ASCII cell */
  --cell-font: 14px;
  --cell-line: 17px;

  color-scheme: dark;
}

@media (max-width: 640px) {
  :root {
    --cell-font: 8px;
    --cell-line: 10px;
  }
}

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

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  -webkit-font-smoothing: antialiased;
}

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 6vw, 80px);
}

.content {
  position: relative;
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  text-align: center;
}

/* empty box, the ASCII name gets drawn on top of it */
.spacer {
  width: 100%;
  height: clamp(92px, 16vw, 210px);
}

.lead {
  margin: 0;
  max-width: 54ch;
  font-size: clamp(15px, 1.3vw, 17px);
  line-height: 1.7;
  color: var(--text-soft);
  text-wrap: pretty;
}

.note {
  margin: 0;
  max-width: 54ch;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-mute);
}

/* ascii */

.layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.grid {
  font-family: var(--mono);
  font-size: var(--cell-font);
  line-height: var(--cell-line);
  /* some phones blow the text up otherwise */
  -webkit-text-size-adjust: none;
  -moz-text-size-adjust: none;
  text-size-adjust: none;
}

.grid pre {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  font: inherit;
  user-select: none;
}

.lines  { color: var(--line); }
.accent { color: var(--accent); }
.edge   { color: var(--name-edge); }
.name   { color: var(--name); }

.probe {
  position: absolute;
  visibility: hidden;
  white-space: pre;
}

/* fades the lines out behind the text */
.veil {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 58% 62% at 50% 50%,
    rgba(11, 11, 14, 0.97) 0%,
    rgba(11, 11, 14, 0.92) 48%,
    rgba(11, 11, 14, 0) 100%
  );
}

/* links */

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(11, 11, 14, 0.6);
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s, background-color 0.15s;
}

.button svg {
  flex: none;
  color: var(--name);
}

.button:hover {
  color: #a9abff;
  border-color: var(--accent);
  background: rgba(133, 135, 255, 0.1);
}

.button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* the real h1 is only there for screen readers, unless JS is off */
.title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.no-js .title {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip-path: none;
  font-family: "Syne", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(72px, 15vw, 200px);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: var(--name);
}

.no-js .spacer {
  display: none;
}

@media (max-width: 640px) {
  .spacer {
    height: 132px;
  }

  /* content is full width on phones, so the veil has to be wider too */
  .veil {
    background: radial-gradient(
      ellipse 130% 52% at 50% 50%,
      rgba(11, 11, 14, 0.97) 0%,
      rgba(11, 11, 14, 0.92) 62%,
      rgba(11, 11, 14, 0) 100%
    );
  }
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}

/* languages */

.stack {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(133, 135, 255, 0.06);
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 500;
}

.tag::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--accent);
}

/* 404: requested path, can be long */
.tag-path {
  max-width: min(100%, 48ch);
  overflow-wrap: anywhere;
}

/* "404" is short, so it is drawn at full height and needs a bit more air */
.spacer-404 {
  margin-block: 14px;
}

/* ---- /skills ---- */

.content-wide {
  max-width: 920px;
  align-items: stretch;
  text-align: left;
  gap: 36px;
}

/* the cards bring their own background, so the veil only needs to calm the
   middle a bit */
.page-skills .veil {
  background: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    rgba(11, 11, 14, 0.9) 0%,
    rgba(11, 11, 14, 0.75) 55%,
    rgba(11, 11, 14, 0) 100%
  );
}

.skills-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--text-mute);
  font-size: 14px;
  text-decoration: none;
  transition: color 0.15s;
}

.crumb svg {
  color: var(--accent);
  transition: transform 0.15s;
}

.crumb:hover {
  color: var(--name);
}

.crumb:hover svg {
  transform: translateX(-3px);
}

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

.skills-title {
  margin: 0;
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.skills-title span {
  color: var(--accent);
}

.langs {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.lang {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(11, 11, 14, 0.82);
  overflow: hidden;
  transition: border-color 0.15s, background-color 0.15s;
}

.lang:hover {
  border-color: var(--accent);
  background: rgba(20, 20, 34, 0.9);
}

.lang-art {
  position: relative;
  height: calc(12 * 10px);
  margin: 22px 18px 4px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 500;
  line-height: 10px;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
}

.lang-art pre {
  position: absolute;
  inset: 0;
  margin: 0;
  font: inherit;
  user-select: none;
}

.lang-fill { color: var(--name); transition: color 0.15s; }
.lang-edge { color: var(--name-edge); }
.lang:hover .lang-fill { color: #b9bbff; }

.lang-probe {
  position: absolute;
  visibility: hidden;
  white-space: pre;
}

.lang-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 10px 18px 12px;
}

.lang-meta h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

.lang-num {
  font-size: 12px;
  color: var(--text-mute);
}

.lang-code {
  margin: 0;
  padding: 12px 18px 14px;
  border-top: 1px dashed var(--border);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-soft);
  white-space: pre;
  overflow-x: auto;
}

.lang-code .fn  { color: var(--name); }
.lang-code .str { color: #d6d7ff; }

.also {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.also-label {
  font-size: 13px;
  color: var(--text-mute);
}

.also .stack {
  justify-content: flex-start;
}

@media (max-width: 760px) {
  .langs {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lang,
  .lang-fill,
  .crumb,
  .crumb svg { transition: none; }
}
