:root {
  --primary-color: 12, 189, 207;
  --primary-bg-color: #1e1e1e;
  --project-item-gap: 2.2rem;
  --project-item-pad: 1.4rem;
  --nav-bar: 45px;
  --page-bg: #111111ea;
  --nav-sel-trans: 6px
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow: hidden;
  color: #ddd;
  font-family: 'Fira Code', 'JetBrains Mono', 'Inter', monospace;
  background-color: var(--primary-bg-color);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

nav {
  --blur: 0px;
  --bg-alpha: 0;

  background: rgba(0, 0, 0, var(--bg-alpha));
  backdrop-filter: blur(var(--blur));

  display: flex;
  width: 100vw;
  justify-content: space-between;
  padding-top: 0.2rem;
  position: fixed;
  top: 0;
  padding-inline-start: 0.8rem;
  padding-inline-end: 1.2rem;
  align-items: center;
  z-index: 2;
  height: var(--nav-bar);
}

#selected-nav::before {
  transform: translateX(calc(-1 * var(--nav-sel-trans)));
  font-weight: 400;
}

#selected-nav {
  color: #fff;
  font-weight: 500;
}

#selected-nav::after {
  transform: translateX(var(--nav-sel-trans));
  font-weight: 400;
}

.brand {
  height: 100%;
  aspect-ratio: 1;
}

.brand>a {
  display: block;
  padding: 0.3rem;
}

.brand>a>img {
  width: 100%;
  height: 100%;
}

nav ul {
  display: flex;
}

nav ul li {
  margin-inline-start: 2rem;
}

nav ul li a {
  position: relative;
  display: inline-block;
  padding: 0.6rem 1rem;
  color: #ddd;
  text-decoration: none;
  transition: all 300ms;
}

nav ul li a:hover {
  color: #fff;
  font-weight: 500;
}

nav ul li a::before {
  position: absolute;
  left: 0;
  content: '[';
  transform-origin: bottom center;
  transition: transform 200ms ease-out;
}

nav ul li a::after {
  content: ']';
  position: absolute;
  right: 0;
  transform-origin: bottom center;
  transition: transform 200ms ease-out;
}

nav ul li a:hover::before {
  transform: translateX(calc(-1 * var(--nav-sel-trans)));
  font-weight: 400;
}

nav ul li a:hover::after {
  transform: translateX(var(--nav-sel-trans));
  font-weight: 400;
}

main {
  width: 100dvw;
  height: 100dvh;
  overflow-y: auto;
  position: relative;
  z-index: 2;
}

canvas#bg {
  background: var(--primary-bg-color);
  position: fixed;
  inset: 0;
  width: 100dvw;
  height: 100dvh;
  pointer-events: none;
  z-index: 1;
}

.social-links {
  width: 4.6rem;
  padding: 5rem 1rem;
  display: flex;
  position: fixed;
  left: 0;
  bottom: 0;
  flex-direction: column;
  justify-content: end;
  z-index: 1;
}

.social-links>ul,
nav ul {
  list-style-type: none;
}

.social-links>ul li {
  margin-bottom: 0.6rem;
}

.social-links>ul li a,
.project-links a {
  display: block;
  padding: 0.5rem;
  color: #ddd;
  width: 36px;
  transition: transform 200ms ease,
    background-color 200ms ease,
    box-shadow 200ms ease;
}

main {
  counter-reset: section;
}

main>section:nth-of-type(n + 2) {
  counter-increment: section;
}

.section-header {
  padding: 1rem 0;
  color: #fff;
  font-weight: 900;
  margin: 1rem 0;
  font-size: 1.8rem;
  position: relative;
}

.section-header::before {
  content: "0" counter(section) ". ";
  color: rgb(var(--primary-color));
  font-size: 1.4rem;
}

.section-header::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 1px;
  width: 40%;
  margin-left: 16px;
  background: #777;
}

main>section {
  width: 100%;
}

#hero {
  min-height: 100vh;
  position: relative;
  padding-inline: 2.6rem;
}

.hero-role {
  background-color: rgba(var(--primary-color), 0.3);
  color: #fff;
  padding: 0.2rem 0.6rem;
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  backdrop-filter: blur(2px);
  text-align: center;
}

.hero-hobby {
  text-align: center;
}

.hero-tagline {}

.hero-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: -1;
  font-size: 1.3rem;
  position: fixed;
  inset: 0;
  --scroll-scale: 1;
  transform: scale(var(--scroll-scale));
  transform-origin: 50% 30%;
}

.hero-right {
  flex: 0.6;
  display: flex;
  justify-content: center;
  backdrop-filter: blur(2px);
  padding: 3px;
  background-color: rgba(var(--primary-color), 0.6);
  clip-path: polygon(26px 0, 100% 0, calc(100% - 26px) 100%, 0 100%);
}

.hero-right>img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: inherit
}

.tagline {
  margin-top: 1rem;
  font-style: italic;
  color: #ffc107;
}

#projects,
#about {
  min-height: 100dvh;
  background-color: var(--page-bg);
  backdrop-filter: blur(4px);
}

.section-container {
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  padding-inline: 5rem;
  margin: 0 auto;
  padding-bottom: 8rem;
}

#about .section-content {
  display: flex;
  flex-direction: row-reverse;
  column-gap: 2rem;
}

#about .image {
  position: relative;
  flex: 0 0 40%;
  max-width: 40%;
}

.img-wrapper {
  position: relative;
  border-radius: 8px;
  border: 3px solid #ddd;
}

.img-wrapper::before {
  position: relative;
  display: inline-block;
  content: "";
  position: absolute;
  inset: 0;

  border-radius: inherit;
  background: transparent;
  border: 3px solid rgb(var(--primary-color));

  transform: translate(12px, 12px);
  z-index: 0;
}


#about .section-content img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
  position: relative;
  z-index: 1;
  filter: grayscale(100%);
}

#about .section-content .profession {
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
}


#about .section-content .info {
  font-size: 1.16rem;
  margin-top: 1.2rem;
}

#about .section-content .info p {
  letter-spacing: 0px;
  margin-top: 1rem;
}

#about .pro-tagline {
  font-size: 1.16rem;
  margin-top: 0.6rem;
}

#about .pro-tagline::before {
  content: "\201C";
  color: #ffc107;
}

#about .pro-tagline::after {
  content: "\201D";
  color: #ffc107;
}

.a-link {
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgb(var(--primary-color));
}

.a-link::after {
  content: "↗";
  transition: transform 0.2s ease;
}

.a-button {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 8px 16px;
  background-color: rgb(var(--primary-color));
  color: #fff;

  margin-top: 2rem;
  font-size: 1.2rem;
  font-weight: 500;

  border-radius: 8px;
  align-self: flex-start;

  transition:
    transform 0.15s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
}

.a-button::after {
  content: "↗";
  font-size: 0.9em;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.highlight-word {
  color: #ffc107;
}

#projects .section-content {
  display: flex;
  flex-direction: column;
}

#projects .section-content>ul {
  list-style-type: none;
}

.project-item {
  display: flex;
  gap: 1.3rem;
  margin-bottom: var(--project-item-gap);
  align-items: center;
  position: relative;
}

.project-item-image {
  flex: 0 0 44%;
  max-width: 44%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 4px;
}

.project-item-image>img,
.project-item-image>video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: end;
}

.project-content>h5 {
  color: #777;
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.project-item-summary {
  position: relative;
  width: 110%;
  right: 0;
  left: -10%;
  background-color: var(--primary-bg-color);
  padding: 0.6rem;
  border-radius: 4px;
}

.project-tags {
  display: flex;
  width: 100%;
  flex-wrap: wrap;
  column-gap: 12px;
  row-gap: 0px;
}

.project-tag {
  color: rgb(var(--primary-color));
  white-space: nowrap;
}

#projects .more {
  display: flex;
  align-items: center;
  justify-content: start;
  padding-bottom: 4rem;
}

.project-item:nth-child(even) {
  flex-direction: row-reverse;
}

.project-item:nth-child(even) .project-item-summary {
  left: 0%;
  right: -10%;
}

.project-item:nth-child(even) .project-content {
  text-align: start;
}

.project-item:nth-child(odd) .project-tags {
  justify-content: end;
}

.project-links a {
  display: inline-flex;
  text-decoration: none;
  color: #fff;
}

.hero-content h1 {
  font-size: 2rem;
}

footer {
  text-align: center;
  color: #777;
  font-size: 0.9rem;
  padding-top: 10rem;
  padding-bottom: 2.4rem;
  background-color: var(--page-bg);
  backdrop-filter: blur(2px);
}

.integral-footer {
  font-size: 13px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
}

.integral-wrapper {
  display: inline-flex;
  align-items: center;
}

.integral-symbol {
  font-size: 1.5em;
  line-height: 1;
  font-weight: normal;
}

.limits {
  display: flex;
  flex-direction: column;
  margin-left: 2px;
  font-size: 0.7em;
  line-height: 1;
  gap: 12px;
}

.limit-lower-bound {
  left: -10px;
  position: relative;
}

.limit-upper-bound {}

.math-var {
  font-style: normal;
}

.copyright-footer {
  margin-top: 20px;
}

@media (max-width: 768px) {
  .section-container {
    padding-inline: 2rem;
  }

  .section-header {
    font-size: 1.5rem;
  }

  .section-header::before {
    font-size: 1.2rem;
  }

  .social-links {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding-top: 10rem;
    padding-bottom: 1rem;
    background-color: var(--page-bg);
    backdrop-filter: blur(2px);
  }

  .social-links>ul {
    display: flex;
    gap: 8px;
  }

  .social-links>ul>li {
    margin: 0;
  }

  .project-item {
    overflow: hidden;
    border-radius: 4px;
  }

  .project-item-image {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }

  .project-content {
    position: absolute;
    inset: 0;
    justify-content: flex-end;
    color: #fff;
    padding: 0.8rem;
    z-index: 2;
  }

  .project-meta,
  .project-content {
    gap: 6px;
  }

  .project-item-summary {
    position: relative;
    width: 100%;
    inset: 0;
    background: none;
    padding: 0;
  }

  .project-meta {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(100%);
    transition:
      max-height 0.35s ease,
      opacity 0.25s ease,
      transform 0.35s ease;
  }

  .project-content::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;

    height: 78px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.01));
    backdrop-filter: blur(1px);
    transition: height 0.35s ease;
    z-index: -1;
  }

  .project-item:hover .project-meta {
    max-height: 100%;
    opacity: 1;
    transform: translateY(0);
    backdrop-filter: blur(2px);
  }

  .project-item:hover .project-content::before {
    height: 100%;
  }

  footer {
    padding-top: 1rem;
  }

  #about .image {
    max-width: 60%;
    width: 50%;
  }

  .integral-footer {
    font-size: 12px;
  }
}

@media (max-width: 580px) {
  :root {
    --nav-sel-trans: 4px
  }

  .hero-content h1 {
    font-size: 1.8rem;
  }

  .hero-role, .hero-hobby {
    font-size: 1.2rem;
  }

  #projects .section-content ul li:nth-child(2n) {
    flex-direction: column;
  }

  .project-item {
    flex-direction: column;
    gap: 0;
    background-color: var(--primary-bg-color);
  }

  .section-container {
    padding-inline: 1.2rem;
    position: relative;
  }

  .project-content::before {
    display: none;
  }

  .project-content {
    position: relative;
  }

  .project-meta {
    max-height: none;
    opacity: 1;
    transform: none;
  }

  .project-item:hover .project-meta {
    max-height: none;
    opacity: 1;
    transform: none;
  }

  .social-links>ul li a,
  .project-links a {
    width: 34px;
  }

  nav {
    padding-top: 0.2rem;
    padding-inline-start: 0.2rem;
    padding-inline-end: 1rem;
  }

  nav ul li {
    margin-inline-start: 1rem;
  }

  nav ul li a {
    padding: 0.6rem 0.8rem;
  }

  .section-header {
    font-size: 1.4rem;
  }

  .section-header::before {
    font-size: 1.1rem;
  }

  #about .section-content {
    flex-direction: column;
  }

  #about .section-content .profession {
    font-size: 1.1rem;
    margin-top: 2rem;
  }

  #about .section-content .info {
    font-size: 1.1rem;
    margin-top: 1.1rem;
  }

  #about .pro-tagline {
    font-size: 1.1rem;
    margin-top: 2px;
  }

  #about .image {
    width: 54%;
  }

  .integral-footer {
    font-size: 11px;
  }
}

@media (max-width: 420px) {
  :root {
    --nav-sel-trans: 3px
  }

  nav ul li {
    margin-inline-start: 0.6rem;
  }

  nav ul li a {
    padding: 0.6rem 0.6rem;
  }

  #hero {
    padding-inline: 1.6rem;
  }

  .hero-content h1 {
    font-size: 1.6rem;
  }

  .hero-role, .hero-hobby {
    font-size: 1rem;
  }

  .section-header {
    font-size: 1.2rem;
  }

  .section-header::before {
    font-size: 0.9rem;
  }

  .project-type {
    font-size: 0.8rem;
  }

  .project-title {
    font-size: 1rem
  }

  .project-content {
    gap: 2px;
    padding: 12px;
  }

  .project-meta {
    gap: 2px;
  }

  .project-item-summary,
  .project-tags {
    font-size: 0.8rem
  }

  #about .section-content .profession {
    font-size: 1rem;
  }

  #about .section-content .info {
    font-size: 1rem;
    margin-top: 1rem;
  }

  #about .pro-tagline {
    font-size: 1rem;
  }

  #about .image {
    width: 54%;
  }

  .integral-footer {
    font-size: 10px;
  }
}

@media (max-width: 378px) {
  :root {
    --nav-bar: 36px;
  }

  nav {
    padding-top: 0rem;
  }

  nav ul li {
    margin-inline-start: 0.4rem;
  }

  nav ul li a {
    font-size: 12px;
    padding-inline: 7px;
  }

  #hero {
    padding-inline: 16px;
  }

  .hero-content h1 {
    font-size: 1.4rem;
  }

  .hero-role, .hero-hobby {
    font-size: 0.9rem;
  }

  footer {
    font-size: 0.8rem;
  }
}

@media (max-width: 340px) {
  nav ul li {
    margin-inline-start: 0.4rem;
  }

  nav ul li a {
    padding-inline: 5px;
  }
}


@media (max-width: 240px) {}

@media (hover: hover) {
  .a-button:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  }

  .a-button:hover::after {
    transform: translate(2px, -2px);
  }

  .social-links>ul li a:hover,
  .project-links a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  }
}

.a-button:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.a-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.6);
  outline-offset: 3px;
}

.social-links>ul li a:active,
.project-links a:active {
  transform: translateY(1px) scale(0.98);
}