body {
  margin: 0;
  font-family: 'Noto Sans', sans-serif;
  overflow-x: hidden;
}

#canvas {
  display: block;
  position: fixed;
  top: 0; left: 0;
  z-index: -1;
  pointer-events: none;
}

.topBar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  box-sizing: border-box;
  z-index: 10;

  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 3rem;
  background: transparent;
}


.topBar a {
  color: #ffffff;
  text-decoration: none;
  transition: color 0.2s ease;
}
.topBar a:hover {
  color: #ffffff;
}

.home {
  font-weight: bold;
  font-size: 1.5rem;
}

.nav {
  display: flex;
  gap: 2.5rem;        /* Controls spacing between each button */
  list-style: none;   /* Removes bullet points */
  margin: 0;          /* Removes default browser ul margin */
  padding: 0;         /* Removes default browser ul left padding */
}
.nav a {
  color: #808080;
  font-size: 0.95rem;
  font-weight: lighter;
}

.nav a:hover {
  color: #ffffff;
  font-weight: bolder;
}

.title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14rem 1.5rem 6rem; /* Top | Left & Right | Bottom */
}

.title h1 {
  margin: 0;
  font-size: clamp(3.5rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.subtitle {
  margin: 0.75rem 0 0;
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 400;
  color: #a6a6a6;

  line-height: 1.5;
  height: 1.5em;
  overflow: hidden;
}

.subtitle span {
  display: inline-block;
  position: relative;
  animation: subtitleRotate 8s ease-in-out infinite;
}

.subtitle2 {
  margin: 1.5rem 0 0;
  /* rotate: 8deg;
  translate: -14rem 0; */
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  font-weight: 300;
  color: #737373;
}

@keyframes subtitleRotate {
  0%, 22% {
    top: 0;
  }
  28%, 55% {
    top: -1.5em; /* 1 line up */
  }
  61%, 88% {
    top: -3em;   /* 2 lines up */
  }
  94%, 100% {
    top: -4.5em; /* 3 lines up (hits the duplicate first line, then loops cleanly to 0) */
  }
}

/* TYPEWRITER ANIMATION*/
.typewriter h1 {
  width: 15ch;
  overflow: hidden; /* Ensures the content is not revealed until the animation */
  border-right: .10em solid transparent; /* The typwriter cursor */
  white-space: nowrap; /* Keeps the content on a single line */
  margin: 0 auto; /* Gives that scrolling effect as the typing happens */
  letter-spacing: .03em; /* Adjust as needed */
  animation: 
    typing 2.5s steps(40, end),
    blink-caret .5s step-end infinite ;
}

/* The typing effect */
@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

/* The typewriter cursor effect */
@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: white; }
}

.fadeUp {
  opacity: 0;
  transform: translateY(25px);
  animation: fadeUp 0.8s ease-out forwards;
  animation-delay: calc(var(--i, 0) * 0.4s);
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slideLeft,
.slideRight {
  opacity: 0;
  animation-duration: 0.55s;
  animation-timing-function: ease;
  animation-fill-mode: forwards;
  animation-delay: calc(var(--i, 0) * 0.4s);
}

.slideLeft.in-view {
  animation-name: slideInLeft;
}

.slideRight.in-view {
  animation-name: slideInRight;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20.5rem); /* Starts 40px to the left */
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20.5rem); /* Starts 40px to the right */
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.image-section {
  position: relative;
  min-height: 60vh;
  display: flex;
  align-items: center;            /* Vertically centers text and graphic together */
  justify-content: space-between; /* Pushes text left, graphic right */
  gap: 3rem;                      /* Minimum spacing between text and graphic */
  text-align: left;
  padding: 2rem 20vw;
  color: #ffffff;
}

.image-section-vertical {
  flex-direction: column;
  align-items: flex-start; 
}

.text-col {
  flex: 1;
  max-width: 55%; /* Prevents text from stretching too far right */
}

.graphic-col img {
  max-width: 100%;
  height: auto;
}

.image-section::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background-image: var(--bg-img);
  background-size: 50rem;
  background-position: center;
  background-repeat: no-repeat;

  rotate: -8deg; /* Keeps your 2D tilt intact */
  filter: brightness(0.25);
  animation: float3D 8s ease-in-out infinite alternate;
  -webkit-mask-image: repeating-linear-gradient(
  to bottom,
  black 0px,
  black 3px,
  transparent 3px,
  transparent 5px
  );
  mask-image: repeating-linear-gradient(
    to bottom,
    black 0px,
    black 3px,
    transparent 3px,
    transparent 5px
  );
  image-rendering: pixelated; /* Forces sharp, crunchy pixel edges */
}

@keyframes float3D {
  0% {
    transform: perspective(600px) rotateX(-6deg) rotateY(-10deg) skewX(-3deg) scale(1);
  }
  50% {
    transform: perspective(600px) rotateX(6deg) rotateY(4deg) skewX(2deg) scale(1.04);
  }
  100% {
    transform: perspective(600px) rotateX(-4deg) rotateY(10deg) skewX(-2deg) scale(0.98);
  }
}

.subHeader{
  font-size: 3rem;
}

.underline {
  position: relative;
  display: inline-block;
  text-decoration: none;
}

.underline::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px; /* Distance below the text */
  width: 100%;
  height: 4px;  /* Thickest point on the left */
  background: #ffffff;

  /* Tapers from full 4px height on the left (0% 0%, 0% 100%) down to a 0px point on the right (100% 50%) */
  clip-path: polygon(0% 0%, 100% 50%, 0% 100%);
  transition: clip-path 0.75s ease;
}

.underline:hover::after {
  clip-path: polygon(0% 50%, 100% 0%, 100% 100%);
}

.graphic-col {
  flex: 1;
  display: flex;
  justify-content: left;
  align-items: left;
}

.stats-grid {
  display: grid;
  /* grid-template-columns: repeat(2, minmax(0, 1fr)); */
  gap: 0.75rem;
  width: 100%;
  max-width: 24rem;
}
.stats-grid-rectangle {
  display: grid;
  /* grid-template-columns: repeat(2, minmax(0, 1fr)); */
  gap: 0.75rem;
  width: 100%;
  max-width: 100vw;
}
.stats-grid-fit {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  width: 60%;
  align-self: center;
}

.stat-box {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.25rem;
  min-height: 5.5rem;

  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.stat-box-green {
  background: #154f3c82;
}
.stat-box-red {
  background: #4f151582;
}

.stat-box:first-child, .stat-box:last-child {
  translate: -50px 0;
}

/* Subtle top-left corner bracket accent */
.stat-box::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 8px;
  height: 8px;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  opacity: 0.5;
  transition: opacity 0.25s ease;
}

.stat-box:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-3px);
}

.stat-box-green:hover{
    background: #154f3ce4;
}
.stat-box-red:hover{
    background: #4f1515e4;
}

.stat-box:hover::before {
  opacity: 1;
}

.stat-label {
  font-family: monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
}

.header-label {
  font-family: monospace;
  font-size: 1.75rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
}

.contact-label {
  font-family: monospace;
  font-size: 1.25rem; 
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.45);
}

.stat-description {
  font-family: monospace;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.45);
  padding: 10px 0px;
}

.stat-value {
  margin-top: 0.75rem;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.stat-box-row {
  flex-direction: row;
  align-items: center; /* Vertically centers the left text with the label+value stack */
  justify-content: flex-start;
  gap: 1.5rem;         /* Space between the left text and the right stack */
}

.stat-side {
  font-family: monospace;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.45);
  flex-shrink: 0;
  width: 6.5rem;
}

.stat-content {
  display: flex;
  flex-direction: column;
}


.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: dense; /* Automatically backfills empty holes around larger boxes */
  align-items: start;    /* Lets shorter boxes hug their own content instead of stretching */
  gap: 0.75rem;
  width: 100%;
}

.project-card {
  translate: none !important; /* Overrides the -50px offset from .stat-box:first-child/:last-child */
  justify-content: flex-start;
  min-height: 0;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 0.75rem;
}

.project-icon {
  width: 5rem;
  height: 5rem;
  object-fit: contain;
  opacity: 1;
  transition: transform 0.5s ease;
}

.project-card:hover .project-icon {
  transform: scale(1.1) rotate(-366deg);
}

/* Spanning modifiers so boxes resize around neighboring items */
.span-2 {
  grid-column: span 2;
}

.span-3 {
  grid-column: span 3;
}

.span-row-2 {
  grid-row: span 2;
  align-self: stretch; /* Stretches tall cards across both rows cleanly */
}

/* Collapse to 1 column on smaller screens so 3 columns don't get squished */
@media (max-width: 900px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .span-2,
  .span-3,
  .span-row-2 {
    grid-column: span 1;
    grid-row: span 1;
  }
}

/* TAGS FOR BOXES */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

/* Individual pill-shaped tag bubble */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  line-height: 1.2;
  white-space: nowrap;
  border-radius: 999px;
  
  color: var(--text-color, currentColor);
  background-color: color-mix(in srgb, currentColor 8%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
              background-color 0.18s ease,
              border-color 0.18s ease;
  user-select: none;
}

.tag:hover {
  transform: translateY(-2px);
  background-color: color-mix(in srgb, currentColor 16%, transparent);
  border-color: color-mix(in srgb, currentColor 45%, transparent);
}

.coursework-tag{
  font-family: monospace;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: rgba(14, 225, 7, 0.708);
  padding: 10px 0px 0px 0px;
}

#skills, #contact {
  justify-content: flex-start;
  min-height: auto;
  gap: 3rem;
}

#skills .subHeader, #contact .subHeader {
  margin-bottom: 0;
}

#skills .stat-box, #contact .stat-box {
  translate: none;
}

.mango-wrapper {
  position: fixed;
  bottom: -2rem;
  right: 1.5rem;
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.contact-wrapper {
  position: absolute;
  top: 260px;
  left: 6rem;
  transform: rotate(-8deg);
  z-index: 9;
  display: flex;
  flex-direction: column;
  align-items: center;

  padding: 1.25rem;
  min-height: 1rem;

  text-decoration: none;
  color: inherit;

  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  transition: border-color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.contact-wrapper::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  width: 8px;
  height: 8px;
  border-top: 2px solid #ffffff;
  border-left: 2px solid #ffffff;
  opacity: 0.5;
  transition: opacity 0.25s ease;
}

.contact-wrapper:hover {
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-3px);
}



.mango-tooltip {
  margin-bottom: 1.15rem;
  padding: 0.25rem 0.6rem;
  font-family: monospace;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  white-space: nowrap;
  color: red;
  background: rgba(15, 15, 15, 0.85);
  border: 1px solid rgba(227, 8, 8, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 4px;

  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.mango-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.corner-mango {
  width: 6rem;
  height: auto;
  cursor: pointer;
  user-select: none;
  transition: transform 0.5s ease;
}

.corner-mango:hover {
  transform: translateY(-20px) scale(1.1) rotate(-6deg);
}

.corner-mango.shake {
  animation: mangoErrorShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes mangoErrorShake {
  0%, 100% {
    transform: translateY(-20px) scale(1.1) rotate(-6deg);
  }
  15%, 45%, 75% {
    transform: translateY(-20px) translateX(-11px) scale(1.1) rotate(-14deg);
  }
  30%, 60%, 90% {
    transform: translateY(-20px) translateX(11px) scale(1.1) rotate(2deg);
  }
}

