:root {
  /* Fonts */
  --font-mono: "0xProto", monospace;
  --font-display: "Monocraft", monospace;

  /* Font Weights */
  --weight-normal: 400;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* Font Sizes */
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* Spacing */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;

  /* Sizes */
  --size-icon: 1.25rem;
  --size-profile: 15rem;

  /* Max Widths */
  --max-w-nav: 28rem;
  --max-w-content: 28rem;
  --max-w-container: 64rem;

  /* Border Radius */
  --radius-md: 0.375rem;

  /* Colors */
  --color-bg: rgb(255, 227, 232);
  --color-text: rgb(53, 32, 36);
  --color-muted: rgb(120, 113, 108);
  --color-accent: rgb(255, 134, 156);

  /* Code Colors */
  --color-code-bg: rgb(255, 210, 220);
  --color-code-number: rgb(220, 80, 120);
  --color-code-string: rgb(200, 60, 100);
  --color-code-comment: rgb(180, 150, 160);
  --color-code-keyword: rgb(180, 50, 90);
  --color-code-title: rgb(230, 90, 140);
  --color-code-variable: rgb(150, 70, 100);
  --color-code-type: rgb(190, 80, 130);
  --color-code-attr: rgb(170, 90, 120);
  --color-code-params: rgb(120, 60, 80);

  /* Responsive Typography */
  --title-size: var(--text-xl);
  --subtitle-size: var(--text-lg);
  --body-size: var(--text-base);
  --small-size: var(--text-sm);
}

/* ---- Responsive Tokens --------------------------------------------------- */

@media (min-width: 768px) {
  :root {
    --title-size: var(--text-2xl);
    --subtitle-size: var(--text-xl);
    --body-size: var(--text-lg);
    --size-icon: 1.5rem;
    --max-w-content: 36rem;
  }
}

@media (min-width: 1280px) {
  :root {
    --title-size: var(--text-3xl);
    --subtitle-size: var(--text-2xl);
    --body-size: var(--text-xl);
    --max-w-content: 42rem;
  }
}

@media (min-width: 1536px) {
  :root {
    --max-w-content: 48rem;
  }
}

/* ---- Fonts --------------------------------------------------------------- */

@font-face {
  font-family: "0xProto";
  src: url("/fonts/0xproto.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "0xProto";
  src: url("/fonts/0xproto_bold.woff2") format("woff2");
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Monocraft";
  src: url("/fonts/monocraft.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Monocraft";
  src: url("/fonts/monocraft_bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---- Animations ---------------------------------------------------------- */

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---- Base / Reset -------------------------------------------------------- */

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

html {
  min-height: 100vh;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-inline: var(--space-4);
  max-width: var(--max-w-container);
  margin-inline: auto;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

ul {
  list-style: none;
}

img {
  display: block;
  max-width: 100%;
}

figure {
  margin: 0;
}

address {
  font-style: normal;
}

::selection {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

/* ---- Layout -------------------------------------------------------------- */

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.5s ease-out;
}

/* ---- Header & Navigation ------------------------------------------------- */

.header {
  padding-block: var(--space-4);
}

.nav-list {
  display: flex;
  justify-content: space-around;
  max-width: var(--max-w-nav);
  margin-inline: auto;
  font-size: var(--body-size);
}

.nav-list a {
  position: relative;
  padding-bottom: var(--space-1);
}

.nav-list a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--color-accent);
  transition: width 0.25s ease, left 0.25s ease;
}

.nav-list a:hover::after {
  width: 100%;
  left: 0;
}

.nav-list a:hover {
  color: var(--color-accent);
}

/* ---- Footer -------------------------------------------------------------- */

.footer {
  padding-block: var(--space-4);
}

.footer-text {
  text-align: center;
  font-size: var(--small-size);
  color: var(--color-muted);
}

.footer-link {
  text-decoration: underline;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--color-accent);
}

/* ---- Typography ---------------------------------------------------------- */

.title {
  font-weight: var(--weight-bold);
  font-size: var(--title-size);
  line-height: var(--leading-tight);
}

.subtitle {
  font-weight: var(--weight-semibold);
  font-size: var(--subtitle-size);
  line-height: var(--leading-relaxed);
}

.description {
  margin-top: var(--space-4);
  text-align: justify;
  line-height: var(--leading-normal);
  font-size: var(--body-size);
  max-width: var(--max-w-content);
}

/* ---- Home Section -------------------------------------------------------- */

.home-section {
  display: block;
}

@media (min-width: 640px) {
  .home-section {
    display: flex;
    gap: var(--space-6);
  }
}

.profile-image {
  border-radius: var(--radius-md);
  width: var(--size-profile);
  height: var(--size-profile);
  animation: fade-in 0.5s ease-out;
}

@media (min-width: 640px) {
  :root {
    --size-profile: 12.5rem;
  }
}

@media (min-width: 768px) {
  :root {
    --size-profile: 15rem;
  }
}

@media (min-width: 1024px) {
  :root {
    --size-profile: 20rem;
  }
}

@media (min-width: 1280px) {
  :root {
    --size-profile: 22.5rem;
  }
}

.profile-info {
  margin-top: var(--space-3);
  animation: fade-in-up 0.5s ease-out 0.2s backwards;
}

@media (min-width: 640px) {
  .profile-info {
    flex: 1;
    margin-top: var(--space-0);
  }
}

/* ---- Links & Tags -------------------------------------------------------- */

.tag {
  color: var(--color-accent);
  transition: opacity 0.2s ease;
}

.tag:hover {
  opacity: 0.7;
}

.home-link {
  color: var(--color-accent);
  font-size: var(--body-size);
  transition: opacity 0.2s ease;
}

.home-link:hover {
  opacity: 0.7;
}

/* ---- Icon ---------------------------------------------------------------- */

.icon {
  width: var(--size-icon);
  height: var(--size-icon);
}

/* ---- Projects Section ---------------------------------------------------- */

.projects-list {
  margin-top: var(--space-4);
}

.projects-list > li {
  animation: fade-in-up 0.4s ease-out backwards;
}

.projects-list > li:nth-child(1) { animation-delay: 0.1s; }
.projects-list > li:nth-child(2) { animation-delay: 0.2s; }
.projects-list > li:nth-child(3) { animation-delay: 0.3s; }
.projects-list > li:nth-child(4) { animation-delay: 0.4s; }
.projects-list > li:nth-child(5) { animation-delay: 0.5s; }

.project-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

@media (min-width: 768px) {
  .project-header {
    gap: var(--space-3);
  }
}

.github-link {
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.github-link:hover {
  transform: scale(1.15);
  opacity: 0.8;
}

.project-description {
  text-align: justify;
  line-height: var(--leading-normal);
  font-size: var(--body-size);
  max-width: var(--max-w-content);
}

.project-tags {
  margin-top: var(--space-2);
  font-size: var(--body-size);
}

/* ---- Contact Section ----------------------------------------------------- */

.contact-description {
  margin-top: var(--space-2);
  text-align: justify;
  line-height: var(--leading-normal);
  font-size: var(--body-size);
  max-width: var(--max-w-content);
}

.socials-list {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-width: var(--max-w-content);
}

@media (min-width: 640px) {
  .socials-list {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-around;
  }
}

.social-item {
  width: 100%;
  animation: fade-in-up 0.4s ease-out backwards;
}

.social-item:nth-child(1) { animation-delay: 0.1s; }
.social-item:nth-child(2) { animation-delay: 0.15s; }
.social-item:nth-child(3) { animation-delay: 0.2s; }
.social-item:nth-child(4) { animation-delay: 0.25s; }
.social-item:nth-child(5) { animation-delay: 0.3s; }
.social-item:nth-child(6) { animation-delay: 0.35s; }

@media (min-width: 640px) {
  .social-item {
    width: 49%;
  }
}

.social-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.social-name {
  font-size: var(--body-size);
}

.social-link {
  display: block;
  text-decoration: underline;
  color: var(--color-accent);
  font-size: var(--body-size);
  transition: opacity 0.2s ease;
}

.social-link:hover {
  opacity: 0.7;
}

/* ---- Blog Section -------------------------------------------------------- */

.posts-list {
  margin-top: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: var(--max-w-content);
}

.posts-list > li {
  animation: fade-in-up 0.4s ease-out backwards;
}

.posts-list > li:nth-child(1) { animation-delay: 0.1s; }
.posts-list > li:nth-child(2) { animation-delay: 0.2s; }
.posts-list > li:nth-child(3) { animation-delay: 0.3s; }
.posts-list > li:nth-child(4) { animation-delay: 0.4s; }
.posts-list > li:nth-child(5) { animation-delay: 0.5s; }

.post-preview {
  display: block;
}

.post-title {
  font-weight: var(--weight-bold);
  font-size: var(--subtitle-size);
}

.post-date {
  display: block;
  margin-top: var(--space-2);
  font-style: italic;
  font-size: var(--body-size);
  line-height: var(--leading-normal);
}

.post-tags {
  font-size: var(--body-size);
  line-height: var(--leading-normal);
}

.post-tag {
  color: var(--color-accent);
}

.post-description {
  margin-top: var(--space-2);
  font-size: var(--body-size);
  line-height: var(--leading-normal);
  text-align: justify;
}

.post-read-more {
  display: inline-block;
  margin-top: var(--space-2);
  font-size: var(--body-size);
  color: var(--color-accent);
  text-decoration: underline;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.post-read-more:hover {
  transform: translateX(4px);
  opacity: 0.8;
}

/* ---- Blog Post ----------------------------------------------------------- */

.blog-post {
  width: 100%;
  padding-inline: var(--space-4);
}

.blog-back-link {
  display: inline-block;
  font-size: var(--body-size);
  color: var(--color-accent);
  text-decoration: underline;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.blog-back-link:hover {
  transform: translateX(-4px);
  opacity: 0.8;
}

.blog-divider {
  margin-block: var(--space-6);
  border: none;
  border-top: 2px dashed var(--color-accent);
}

.post-header {
  margin-bottom: var(--space-6);
}

.post-header .post-date {
  margin-top: var(--space-2);
}

.post-header .post-tags {
  margin-top: var(--space-2);
}

.post-content {
  font-size: var(--body-size);
  line-height: var(--leading-normal);
  animation: fade-in 0.5s ease-out 0.1s backwards;
}

.post-content p {
  margin-top: var(--space-4);
  text-align: justify;
}

.post-content h2 {
  margin-top: var(--space-6);
  font-weight: var(--weight-bold);
  font-size: var(--subtitle-size);
}

.post-content h3 {
  margin-top: var(--space-4);
  font-weight: var(--weight-semibold);
  font-size: var(--body-size);
}

.post-content a {
  color: var(--color-accent);
  text-decoration: underline;
  transition: opacity 0.2s ease;
}

.post-content a:hover {
  opacity: 0.7;
}

.post-content ul,
.post-content ol {
  margin-top: var(--space-4);
  padding-left: var(--space-6);
}

.post-content ul {
  list-style: disc;
}

.post-content ol {
  list-style: decimal;
}

.post-content li {
  margin-top: var(--space-2);
}

.post-content blockquote {
  margin-top: var(--space-4);
  padding-left: var(--space-4);
  border-left: 4px solid var(--color-accent);
  font-style: italic;
  color: var(--color-muted);
}

.post-content pre {
  margin-top: var(--space-4);
  padding: var(--space-2);
  background-color: var(--color-code-bg);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.post-content code {
  font-family: var(--font-display);
}

.post-content p code,
.post-content li code {
  padding-block: var(--space-1);
  padding-inline: var(--space-3);
  background-color: var(--color-code-bg);
  border-radius: var(--radius-md);
}

.post-content img {
  margin-top: var(--space-4);
  border-radius: var(--radius-md);
}

.post-content hr {
  margin-block: var(--space-6);
  border: none;
  border-top: 2px dashed var(--color-accent);
}

/* ---- 404 Section --------------------------------------------------------- */

.error-title {
  font-weight: var(--weight-bold);
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
}

@media (min-width: 768px) {
  .error-title {
    font-size: var(--text-4xl);
  }
}

.error-text {
  margin-top: var(--space-2);
  font-size: var(--body-size);
}

/* ---- Syntax Highlighting ------------------------------------------------- */

.hljs-number {
  color: var(--color-code-number);
}

.hljs-string {
  color: var(--color-code-string);
}

.hljs-comment {
  color: var(--color-code-comment);
}

.hljs-keyword,
.hljs-built_in,
.hljs-operator {
  color: var(--color-code-keyword);
}

.hljs-title {
  color: var(--color-code-title);
}

.hljs-variable {
  color: var(--color-code-variable);
}

.hljs-type,
.hljs-class {
  color: var(--color-code-type);
}

.hljs-attr,
.hljs-attribute {
  color: var(--color-code-attr);
}

.hljs-params {
  color: var(--color-code-params);
}

.hljs-punctuation {
  color: var(--color-text);
}