@font-face {
  font-family: "Geist";
  src: url("fonts/Geist-ASCII.woff2") format("woff2");
  font-display: optional;
  font-weight: 100 900;
  unicode-range: U+0020-007E;
}

@font-face {
  font-family: "Geist Pixel Circle";
  src: url("fonts/GeistPixel-Circle.woff2") format("woff2");
  font-display: optional;
  unicode-range: U+0020-007E;
}

:root {
  --bg: #ffffff;
  --ink: #111111;
  --ink-soft: #222222;
  --line: #000000;
  --link: #0000ee;
  --link-visited: #551a8b;
  --link-hover: #0000aa;
  --icon-muted: #777777;
  --max-width: 776px;
  --font-body: "Geist", "Courier New", monospace;
  --font-title: "Geist Pixel Circle", "Geist", "Courier New", monospace;
  --tree-elbow: 0.95rem;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #101010;
  --ink: #f2f2f2;
  --ink-soft: #d5d5d5;
  --line: #f2f2f2;
  --link: #77a7ff;
  --link-visited: #c48cff;
  --link-hover: #dbe7ff;
  --icon-muted: #9b9b9b;
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

html {
  font-size: 115%;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) {
    --bg: #101010;
    --ink: #f2f2f2;
    --ink-soft: #d5d5d5;
    --line: #f2f2f2;
    --link: #77a7ff;
    --link-visited: #c48cff;
    --link-hover: #dbe7ff;
    --icon-muted: #9b9b9b;
    color-scheme: dark;
  }
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.55;
}

a {
  color: var(--link);
  text-decoration: underline;
}

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

a:hover {
  color: var(--link-hover);
}

a:focus-visible {
  outline: 2px dotted var(--line);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 3px 6px;
  background: var(--bg);
  color: var(--ink);
  border: 1px dotted var(--line);
  transform: translateY(-160%);
  transition: transform 140ms ease;
}

.skip-link:focus-visible {
  transform: translateY(0);
}

.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 55px 28px 83px;
}

.masthead {
  margin-bottom: 21px;
}

.profile-photo {
  display: block;
  width: 61px;
  height: 61px;
  margin-bottom: 12px;
  border-radius: 4px;
  object-fit: cover;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
  transform-origin: center;
}

.profile-photo:hover {
  transform: scale(1.05);
}

h1 {
  margin: 0;
  font-family: var(--font-title);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 400;
}

.tree-section {
  margin-top: 10px;
}

.tree,
.tree ul {
  margin: 0;
  padding-left: 1.4rem;
  list-style: none;
}

.tree {
  padding-left: 1rem;
}

.tree li {
  position: relative;
  padding: 0.2rem 0 0.2rem 1rem;
}

.tree li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0.2rem;
  bottom: 0;
  width: 1px;
  background: var(--line);
  opacity: 0.25;
}

.tree li::after {
  content: "";
  position: absolute;
  top: var(--tree-elbow);
  left: 0.2rem;
  width: 0.55rem;
  height: 1px;
  background: var(--line);
  opacity: 0.25;
}

.tree li:last-child::before {
  bottom: calc(100% - var(--tree-elbow));
}

.tree > li:first-child::before {
  top: var(--tree-elbow);
}

.tree li > ul > li:first-child::before {
  top: 0;
}

.node {
  display: inline-block;
}

.folder {
  font-weight: 600;
}

.file {
  font-weight: 400;
}

.node-desc {
  display: block;
  margin-top: 0.2rem;
  margin-bottom: 0.4rem;
  padding-left: 0.1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  max-width: 644px;
}

.node-desc p {
  margin: 0 0 0.3rem;
}

.node-desc p:last-child {
  margin-bottom: 0;
}

.footer {
  margin-top: 28px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.corner-mark {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 74px;
  height: auto;
  pointer-events: none;
  transition: filter 180ms ease, opacity 180ms ease;
}

.social-icons {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 0.2rem;
}

.social-icons a {
  display: inline-flex;
  width: 21px;
  height: 21px;
  color: var(--icon-muted);
  text-decoration: none;
  transition: color 220ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.social-icons a:hover {
  color: var(--ink);
  transform: translateY(-1px);
}

.social-icons svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

html[data-theme="dark"] .corner-mark {
  filter: invert(1);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .corner-mark {
    filter: invert(1);
  }
}

@media (max-width: 600px) {
  .page {
    padding: 41px 21px 32px;
  }

  h1 {
    font-size: 1.4rem;
  }

  .profile-photo {
    width: 55px;
    height: 55px;
  }

  .node-desc {
    max-width: none;
  }

  .tree,
  .tree ul {
    padding-left: 1.1rem;
  }

  .tree {
    padding-left: 0.7rem;
  }

  .tree li {
    padding-left: 0.8rem;
  }

  .tree li::before,
  .tree li::after {
    left: 0.12rem;
  }

  .tree li::after {
    width: 0.45rem;
  }

  .footer {
    display: flex;
    align-items: center;
    gap: 16px;
  }

  .footer p {
    margin: 0;
  }

  .corner-mark {
    position: static;
    flex: 0 0 auto;
    width: 45px;
    margin: 0 16px 0 auto;
  }

  .social-icons a {
    width: 20px;
    height: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-photo,
  .social-icons a {
    transition: none;
  }
}
