@font-face {
  font-family: "IosevkaNerdFont";
  src: url("/fonts/IosevkaNerdFont-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}


/* Scale viewport unit: frozen at 1440px, shrinks below ~928px to maintain 2rem margins */
:root {
  --sv: min(18px, calc((100vw - 10rem) / 60));
}

/* Reset some defaults */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  display: none;
}

/* Fonts */

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #0b0b0b;
}

.welcome-area {
  --fade-height: calc(8.9 * var(--sv));
  background: linear-gradient(to bottom,
      #161616 calc(100% - var(--fade-height)),
      #0f0f0f 100%);
  border-radius: 0 0 4rem 4rem;
  padding-bottom: calc(9.8 * var(--sv));
}

@font-face {
  font-family: 'gravity';
  src: url('/fonts/gravity/Gravity-Book.otf') format('opentype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

.gravity {
  font-family: 'gravity', sans-serif;
}

@font-face {
  font-family: 'logos';
  src: url('/fonts/icomoon/fonts/icomoon.ttf') format('truetype');
  font-weight: 100;
  font-style: normal;
  font-display: swap;
}

.scratch:before {
  content: "\e900";
  font-family: 'logos';
  font-style: normal;
  font-weight: normal;
}

.devpost:before {
  content: "\e903";
  font-family: 'logos';
  font-style: normal;
  font-weight: normal;
}

.montserrat-light {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-weight: 200;
  font-style: normal;
}

.italiana-regular {
  font-family: "Italiana", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Header */

.site-header {
  text-align: center;
  display: flex;
  align-items: center;
  padding: 8px 20px;
  margin: 0 20px;

  justify-content: space-between;

  border-bottom: 1px solid #393939
}

.site-header nav ul {
  display: flex;
  gap: clamp(1vw, 5vw, 5vw);
  list-style: none;
  padding-right: 20px;
}

.site-header a {
  font-size: 13px;
  letter-spacing: 1px;
  color: #919191;
  text-decoration: none;
  transition: color 0.2s ease, text-shadow 0.3s ease;
}

.site-header a:hover {
  color: white;
  text-shadow: 0 0 1px #ffffff, 0 0 3px #d0d0d0, 0 0 5px #525252;
}

.logo {
  height: 60px;
  width: 60px;
  position: relative;
  margin: 6px 0;
}

.normal-logo,
.hovered-logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 4px;

  transition: mask 0.3s ease, transform 0.3s ease;
}

.normal-logo {
  filter: brightness(0) invert(1);

  mask: linear-gradient(135deg, black 40%, black 60%, transparent 50%);
  mask-size: 370% 100%;
  mask-position: left;
}

.hovered-logo {
  background-color: white;
  filter: none;

  mask: linear-gradient(135deg, transparent 50%, black 60%, black 40%);
  mask-size: 370% 100%;
  mask-position: left;
}

.logo:hover .normal-logo,
.logo:hover .hovered-logo {
  transform: scale(1.1);
  mask-position: right;
}

/* Name Animation */

#name-solid,
#introduction,
#socials {
  transition: mask 0.8s cubic-bezier(.01, .75, .17, .99);
  mask-image: linear-gradient(90deg, black 50%, transparent 50%);
  mask-size: 200% 100%;
  mask-position: left;
}

#name-solid.hidden-mask,
#introduction.hidden-mask,
#socials.hidden-mask {
  mask-position: right;
}

/* Debugging Boxes */
.intro-container,
.name-card,
#typewriter-name,
#typewriter-intro,
#introduction,
#socials,
.picture {
  /*border: 1px solid white !important;*/
}

#typewriter-name,
#typewriter-wq,
#typewriter-intro,
#typewriter-socials,
#typewriter-pfp,
#ascii-pfp {
  border: 1px solid white !important;
  /*text-shadow: 0 0 2px #ffffff, 0 0 5px #d0d0d0, 0 0 10px #525252 !important;*/
}

.ti-cursor {
  /*box-shadow: 0 0 2px #ffffff, 0 0 5px #d0d0d0, 0 0 10px #525252;
  text-shadow: 0 0 2px #ffffff, 0 0 5px #d0d0d0, 0 0 10px #525252;*/
}

#typewriter-wq {
  width: calc(20 * var(--sv));
  border: 1px solid white !important;
}

.intro-container {
  margin: 4rem auto 0;

  position: relative;
  width: calc(60 * var(--sv));
  height: calc(26 * var(--sv));
}

.name-card {
  width: calc(37 * var(--sv));
  position: relative;
  height: max(2.5rem, calc(8.5 * var(--sv)));
}

#name-solid {
  position: absolute;
  color: white;

  font-size: calc(7 * var(--sv));

  display: inline-block;

}

#typewriter-wq {
  position: absolute;
  color: white;

  font-size: max(4rem, calc(7 * var(--sv)));
  padding: 12px 0;

  display: inline-block;
}

#typewriter-name {
  position: absolute;
  width: 100%;
  color: #ffffff;

  font-size: clamp(2.5rem, calc(5 * var(--sv)), 10rem);
  font-family: "JetBrainsMono Nerd Font", "JetBrains Mono", monospace;

  text-align: left;
}

#container {
  perspective: 1000px;
}

.pfp {
  position: absolute;
  top: 0%;
  left: 62%;

  color: white;
  padding: 20px;
}

#pfp-3d {
  width: calc(22 * var(--sv));
  height: calc(22 * var(--sv));
  background-color: white;
  border-radius: calc(4 * var(--sv));

  float: right;
  display: flex;
  align-items: center;
  justify-content: center;

  /* 3D setup */
  transform-style: preserve-3d;
  transform: perspective(1000px);
}

#pfp-3d .extra-depth {
  width: calc(21 * var(--sv));
  height: calc(21 * var(--sv));
  background: #d0d0d0;
  border-radius: calc(4 * var(--sv));
  float: right;

  display: flex;
  align-items: center;
  justify-content: center;

  transform-style: preserve-3d;
  transform: perspective(1000px);

  transform: translateZ(20px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);

}

.invisible {
  opacity: 0;
}

#pfp-3d .pfp-img {
  width: calc(20 * var(--sv));
  height: calc(20 * var(--sv));
  background: white;
  border-radius: calc(4 * var(--sv));
  float: right;

  transform: translateZ(30px);
  border: 1px solid white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);

  -webkit-font-smoothing: antialiased;
  backface-visibility: hidden;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}

#typewriter-pfp {
  color: white;

  font-size: calc(var(--sv));
  font-family: "JetBrainsMono Nerd Font", "JetBrains Mono", monospace;
}

#ascii-pfp {
  font-family: 'Courier New', Courier, monospace;
  line-height: 1.1;
  margin-left: 6px;
  color: white;
  font-size: calc(0.16 * var(--sv));
  white-space: pre;
}

.ti-cursor {
  font-weight: 100;
  color: white;
  position: relative;
  animation: none !important;
}

.ti-cursor.vim-normal {
  position: absolute;
  opacity: 1 !important;
  margin-left: -0.48em;
  width: 0.6em !important;
  margin-top: 0.15em;
  mix-blend-mode: difference;
  border-top: 1.1em solid white !important;
  background-color: white;
  animation: none !important;
}

.ti-cursor.vim-command {
  position: absolute;
  opacity: 1 !important;
  margin-left: 0.3em;
  width: 0.6em !important;
  margin-top: 0.15em;
  mix-blend-mode: difference;
  border-top: 1.1em solid white !important;
  background-color: white;
  animation: none !important;
}

.ti-cursor.vim-replace {
  position: absolute;
  opacity: 1 !important;
  margin-left: -0.48em;
  width: 0.6em !important;
  margin-top: 1.10em;
  border-bottom: 0.15em solid white !important;
  animation: none !important;
}

#typewriter-intro {
  position: absolute;
  width: 100%;
  color: white;
  font-size: calc(var(--sv));
  padding: 10px;
}

#introduction {
  position: absolute;
  color: white;

  display: inline-block;

  font-size: calc(var(--sv));
  padding: 10px;

}

.hidden {
  display: none !important;
}

#socials {
  padding: 15px;
  height: 10em;

  position: relative;
}

#typewriter-socials {
  position: absolute;
  width: 100%;
  color: white;
  padding: 10px;
  font-size: calc(var(--sv));
  white-space: pre;
}

#socials nav ul {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: left;
  gap: 10px;
  list-style: none;
}

.social-button {
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-flex;

  font-family: 'gravity', sans-serif;

  padding: calc(0.25 * var(--sv)) calc(0.5 * var(--sv));
  color: white;
  border: 1px solid white;
  background-color: #161616;
  border-radius: 25px;

  align-items: center;
  text-align: center;
}

.social-button i {
  position: relative;
  font-size: calc(var(--sv));
  display: inline-flex;
  line-height: 1;
  justify-content: center;
  top: 0;
}

.social-button .button-text {
  font-size: calc(0.8 * var(--sv));
  font-weight: 400;
  padding: calc(0.2 * var(--sv));
}

.social-button:hover {
  box-shadow: 0 0 2px #ffffff, 0 0 5px #d0d0d0, 0 0 10px #525252;
  text-shadow: 0 0 2px #ffffff, 0 0 5px #d0d0d0, 0 0 10px #525252;
}

.devpost-logo {
  height: max(15px, calc(var(--sv)));
  width: max(15px, calc(var(--sv)));
  margin: 0 2px 0 0;
  filter: invert(1);
}

.scratch-logo {
  height: max(15px, calc(var(--sv)));
  width: max(15px, calc(var(--sv)));
  margin: 0 2px 0 0;
  filter: grayscale(100%);
}

.social-button:hover .devpost-logo {
  filter: drop-shadow(0 0 2px #ffffff) drop-shadow(0 0 5px #d0d0d0) drop-shadow(0 0 10px #525252) invert(1);
}

.social-button:hover .scratch-logo {
  filter: drop-shadow(0 0 2px #ffffff) drop-shadow(0 0 5px #d0d0d0) drop-shadow(0 0 10px #525252) grayscale(100%);
}

/* Projects Section */

.projects-wrapper {
  width: 100%;
  padding: 4rem 0 3rem;
}

.projects-section {
  width: calc(60 * var(--sv));
  margin: 2rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.projects-heading {
  color: white;
  font-size: max(1.5rem, calc(3 * var(--sv)));
  margin-bottom: 1rem;
  border-bottom: 1px solid #393939;
  padding-bottom: 0.75rem;
  opacity: 0;
  transform: translateY(2rem);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.projects-heading.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card {
  display: flex;
  flex-direction: row;
  border: 1px solid #393939;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.4s ease, transform 0.4s ease;
  background-color: #1e1e1e;
  position: relative;
  opacity: 0;
  transform: translateY(2rem);
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  border-color: #696969;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.05);
}

.project-image {
  width: calc(15.5 * var(--sv));
  min-width: calc(15.5 * var(--sv));
  height: calc(15.5 * var(--sv));
  overflow: hidden;
  background-color: #111;
  position: relative;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(20%);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.project-card:hover .project-image img {
  filter: grayscale(0%);
  transform: scale(1.03);
}

.project-info {
  padding: 1rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.6rem;
}

.project-title {
  color: white;
  font-family: 'gravity', sans-serif;
  font-size: max(1rem, calc(1.5 * var(--sv)));
}

.project-title-row {
  display: flex;
  align-items: baseline;
}

.project-date {
  position: absolute;
  top: 1rem;
  right: 1.2rem;
  font-size: calc(0.75 * var(--sv));
  color: #555;
  font-family: Arial, sans-serif;
  z-index: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: calc(0.7 * var(--sv));
  color: #aaa;
  border: 1px solid #393939;
  border-radius: 20px;
  padding: 2px 10px;
  font-family: Arial, sans-serif;
}

.project-desc {
  color: #b0b0b0;
  font-size: calc(0.9 * var(--sv));
  font-family: 'gravity', sans-serif;
  line-height: 1.6;
}

.project-links {
  display: flex;
  gap: 8px;
  margin-top: 0.4rem;
}

/* Blog */

.blog-main {
  min-height: calc(100vh - 80px);
  background-color: #0b0b0b;
}

.blog-list-container {
  width: calc(50 * var(--sv));
  margin: 4rem auto;
}


.blog-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.blog-list-item {
  border-bottom: 1px solid #1e1e1e;
  padding: 1.2rem 0;
}

.blog-list-link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  text-decoration: none;
  gap: 1rem;
}

.blog-list-title {
  color: #666;
  font-family: "IosevkaNerdFont", monospace;
  font-size: calc(0.9 * var(--sv));
  transition: color 0.2s ease;
  position: relative;
}

.blog-list-link:hover .blog-list-title {
  color: #aaa;
}


.blog-list-date {
  color: #555;
  font-family: "IosevkaNerdFont", monospace;
  font-size: calc(0.75 * var(--sv));
  white-space: nowrap;
  position: relative;
}

/* Blog post */

.blog-post-container {
  width: calc(50 * var(--sv));
  margin: 4rem auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.blog-back {
  color: #555;
  text-decoration: none;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  transition: color 0.2s ease;
}

.blog-back:hover {
  color: #d0d0d0;
}

.blog-post-title {
  color: white;
  font-size: 1.8rem;
  font-family: 'Noto Sans', sans-serif;
}

.blog-post-date {
  color: #555;
  font-family: Arial, sans-serif;
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
}

.blog-post-content {
  color: white;
  font-family: 'Noto Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  margin-top: 1rem;
  border-top: 1px solid #1e1e1e;
  padding-top: 1.5rem;
}

.blog-post-content h1,
.blog-post-content h2,
.blog-post-content h3 {
  color: white;
  font-family: 'Noto Sans', sans-serif;
  margin: 1rem 0 1.5rem;
}

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

.blog-post-content h2 {
  font-size: 1.4rem;
}

.blog-post-content h3 {
  font-size: 1.1rem;
}

.blog-post-content p {
  margin-bottom: 1.8rem;
}

.blog-post-content br {
  display: block;
  margin-bottom: 0.3rem;
}

.blog-post-content a {
  color: #d0d0d0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.blog-post-content code {
  font-family: "IosevkaNerdFont", monospace;
  font-size: 0.85rem;
  background-color: #2a2a2a;
  border: 1px solid #3a3a3a;
  padding: 2px 6px;
  border-radius: 4px;
  color: #e0e0e0;
}

.blog-post-content pre {
  background-color: #0d0d0d;
  border: 1px solid #222;
  border-radius: 6px;
  padding: 1.2rem 1.4rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.blog-post-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 1rem;
  color: white;
  font-family: "IosevkaNerdFont", monospace;
}

.blog-post-content img {
  max-width: 100%;
  border-radius: 6px;
  margin: 1rem 0;
}

.blog-post-content ul,
.blog-post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.site-footer {
  text-align: center;
  padding: 1rem;
  margin-top: 0;
  font-size: 0.9rem;
  color: #393939;
  border-top: 1px solid #222;
  background-color: #0b0b0b;
}

/* ==================== Mobile ==================== */

@media (max-width: 768px) {

  /* ---- Welcome area ---- */
  .welcome-area {
    padding-bottom: 3rem;
    border-radius: 0 0 2rem 2rem;
  }

  /* ---- Hide animation-only elements ---- */
  #typewriter-name,
  #typewriter-pfp,
  #typewriter-intro,
  #typewriter-socials,
  #typewriter-wq,
  #ascii-pfp,
  #container {
    display: none !important;
  }

  /* ---- Reveal solid cards without animation ---- */
  #name-solid.hidden-mask,
  #introduction.hidden-mask,
  #socials.hidden-mask {
    mask-image: none !important;
  }

  #pfp-3d.invisible {
    opacity: 1;
  }

  /* ---- Intro container: vertical stack ---- */
  .intro-container {
    width: 90%;
    height: auto;
    margin: 2rem auto 0;
    position: static;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
  }

  .name-card {
    width: 100%;
    height: auto;
    text-align: center;
  }

  #name-solid {
    position: relative;
    font-size: clamp(4.5rem, 17vw, 6rem);
    text-align: center;
    display: block;
  }

  /* ---- Pfp card ---- */
  .pfp {
    position: relative;
    top: auto;
    left: auto;
    padding: 0;
  }

  #pfp-3d {
    width: 300px;
    height: 300px;
    border-radius: 24px;
    float: none;
    transform: perspective(1000px) rotateX(5deg) rotateY(-15deg);
  }

  #pfp-3d .extra-depth {
    width: 288px;
    height: 288px;
    border-radius: 24px;
    float: none;
  }

  #pfp-3d .pfp-img {
    width: 276px;
    height: 276px;
    border-radius: 24px;
    float: none;
  }

  /* ---- Introduction ---- */
  #introduction {
    position: relative;
    display: block;
    font-size: 1.25rem;
    padding: 0 1rem;
    text-align: center;
    line-height: 1.6;
  }

  /* ---- Socials ---- */
  #socials {
    position: relative;
    height: auto;
    padding: 0;
    width: 100%;
    text-align: center;
  }

  #socials nav ul {
    justify-content: center;
    gap: 12px;
  }

  .social-button {
    padding: 10px 18px;
    border-radius: 25px;
  }

  .social-button i {
    font-size: 22px;
  }

  .social-button .button-text {
    font-size: 1rem;
    padding: 0 6px;
  }

  /* ---- Projects section ---- */
  .projects-wrapper {
    padding: 2rem 0 2rem;
  }

  .projects-section {
    width: 90%;
    margin: 1rem auto 0;
  }

  .projects-heading {
    font-size: 2.25rem;
  }

  /* ---- Project cards: vertical ---- */
  .project-card {
    flex-direction: column;
  }

  .project-image {
    width: 100%;
    min-width: 0;
    height: 220px;
  }

  .project-date {
    position: static;
    order: 1;
    display: block;
    padding: 0.75rem 1.25rem 0;
    font-size: 0.9rem;
  }

  .project-info {
    padding: 1.25rem;
    gap: 0.75rem;
    order: 2;
  }

  .project-title {
    font-size: 1.5rem;
  }

  .project-desc {
    font-size: 1.1rem;
  }

  .tag {
    font-size: 0.85rem;
    padding: 4px 14px;
  }

  /* ---- Blog ---- */
  .blog-list-container,
  .blog-post-container {
    width: 90%;
    margin: 2rem auto;
  }

  .blog-list-title {
    font-size: 1.1rem;
  }

  .blog-list-date {
    font-size: 0.95rem;
  }

  .blog-post-title {
    font-size: 1.8rem;
  }

  .blog-post-content {
    font-size: 1.1rem;
  }

  /* ---- Header ---- */
  .site-header {
    margin: 0 10px;
  }

  .site-header nav ul {
    gap: 1.5rem;
    padding-right: 0;
  }

  .site-header a {
    font-size: 16px;
  }

  .project-links {
    gap: 10px;
    margin-top: 0.6rem;
  }
}
