/* Import Fonts */
@import url('https://fonts.googleapis.com/css2?family=Arapey:ital@0;1&display=swap');
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&display=swap');
/* Root Variables */
:root {
  --font-family: "Arapey", serif;
  --font-weight: 400;
  --code-font-family: "IBM Plex Mono", monospace;
  --code-font-weight: 300;
  --background-color: #FFFBF2;
  --highlight-color: #F2D9D9;
  --link-color: #5683c3;
  --accent-color: #c64848;
  --text-color: #555;
  --scroll-width: 0%;
  --tooltip-content: 'hibernating';
  --emoji-font-size: 2.5rem;
}

/* Base Styles */
html {
  margin: 0;
  background-color: var(--background-color);
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
::-webkit-scrollbar {
  display: none;
}
body {
  margin: 0 5rem;
}
body * {
  font-family: var(--font-family);
  font-weight: var(--font-weight);
  color: var(--text-color);
}
a {
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}
a:hover {
  cursor: pointer;
  font-weight: bolder;
}

/* Responsive Margins */
@media (max-width: 768px) {
  body {
    margin: 0 2rem;
  }
}
@media (max-width: 480px) {
  body {
    margin: 1rem 2.5rem;
  }
}



/* Navbar */
.navbar {
  position: fixed;
  top: 1rem;
  right: 0;
  width: 100%;
  z-index: 999;
  background-color: var(--background-color);
  padding: 0.5rem 0;
}
.navbar ul {
  list-style: none;
  margin: 0;
  padding: 0 5rem 0 0;
  display: flex;
  gap: 2rem;
  align-items: center;
  justify-content: flex-end;
}
.navbar li {
  position: relative;
}
.navbar a {
  text-decoration: none;
  color: var(--text-color);
  font-style: normal;
  font-size: 1.25rem;
  position: relative;
  padding-left: 1rem;
}
.navbar a::before {
  content: '•';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.25rem;
  opacity: 0;
}
.navbar a.active::before {
  opacity: 1;
  transform: translateY(-50%) scale(1.1);
}
.navbar a:hover {
  text-decoration: underline;
  text-underline-offset: 0.3rem;
}

/* Navbar Responsive */
@media (max-width: 768px) {
  .navbar ul {
    padding-right: 2rem;
    gap: 1.5rem;
  }
  .navbar a {
    font-size: 1.1rem;
    padding-left: 0.8rem;
  }
}
@media (max-width: 480px) {
  .navbar ul {
    display: none;
  }
}

/* Section Layout */
main {
  margin-top: 6rem;
}
.section {
  padding-bottom: 6rem;
}
@media (max-width: 768px) {
  main { margin-top: 5rem; }
}
@media (max-width: 480px) {
  main { margin-top: 4rem; }
  .section { padding-bottom: 4rem; }
}

/* Headings */
h1, h2, h3 {
  color: var(--text-color);
}
h1 {
  font-size: 1.75rem;
  font-style: italic;
  word-spacing: 0.25rem;
  margin: 1rem 0;
}
h2 {
  font-size: 1.75rem;
  font-style: italic;
  margin-bottom: 2rem;
}
h3 {
  font-size: 1.25rem;
}

/* Code & Emphasis */
code {
  font-family: var(--code-font-family);
  font-weight: var(--code-font-weight);
  font-style: normal;
  background-color: var(--highlight-color);
  padding: 0.25rem;
  margin-right: 0.25rem;
  display: inline-block;
  font-size: 1.25rem;
  position: relative;
}
em {
  font-style: normal;
}
@media (max-width: 768px) {
  code { font-size: 1.25rem; padding: 0.2rem; margin-right: 0.2rem; }
}
@media (max-width: 480px) {
  code { font-size: 1rem; padding: 0.15rem; margin-right: 0.15rem; }
}

/* Animated Icons, Tooltip, Squiggles */
@keyframes squiggle { 0%,100%{transform:rotate(-28deg);} 25%{transform:rotate(-33deg);} 75%{transform:rotate(-23deg);} }
@keyframes squiggle-laptop { 0%,100%{transform:rotate(-33deg);} 25%{transform:rotate(-38deg);} 75%{transform:rotate(-28deg);} }
@keyframes squiggle-eyes { 0%,100%{transform:translateX(-50%);} 25%{transform:translateX(-50%) rotate(5deg);} 75%{transform:translateX(-50%) rotate(-5deg);} }
@keyframes squiggle-chart { 0%,100%{transform:translateY(-50%);} 25%{transform:translateY(-50%) scale(1.1);} 75%{transform:translateY(-50%) scale(0.9);} }

/* Project Grid */
.projects-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  width: 100%;
  margin: 0 auto;
}
.project-box {
  border: 1.5px solid var(--text-color);
  background: #fff;
  padding: 1rem 2rem;
  text-align: center;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.project-box:hover {
  background-color: #f2f2f2;
}

@media (max-width: 768px) {
  .projects-container {
    gap: 1rem;
  }
  .project-box {
    padding: 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .projects-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }
  .project-box.expanded {
    flex-direction: column;
    align-items: stretch;
    padding: 2rem;
    background: #fff;
  }
}

/* Project Modal */
#project-detail-root {
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
}
.project-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  z-index: 2001;
  pointer-events: auto;
}
.project-detail-card {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1.5px solid var(--text-color);
  width: 45vh;
  height: 70vh;
  padding: 2rem 1.5rem 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2002;
  animation: modal-pop 0.18s cubic-bezier(.5,1.8,.7,1) 1;
  overflow-y: hidden;
  pointer-events: auto;
}


.project-detail-close {
  position: absolute;
  top: 0.3rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 2.5rem;
  color: var(--text-color);
  cursor: pointer;
  z-index: 2003;
}
.project-detail-close:hover {
  color: var(--accent-color);
}
@keyframes modal-pop {
  0% { opacity: 0; transform: translate(-50%, -48%) scale(0.98); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* Project Detail Elements */
.project-detail-img-wrap {
  width: 100%;
  aspect-ratio: 2/1;
  background: #eee;
  border: 1px solid var(--text-color);
  margin: 1.5rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.project-detail-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project-detail-title {
    font-size: 1.2rem;
    text-align: left;
    width: 100%;
}

.project-detail-link {
    font-style: normal;
}

.project-detail-desc {
  font-size: 1rem;
  line-height: 150%;
  margin-bottom: 2rem;
  text-align: left;
  width: 100%;
}

@media (max-width: 480px) {
    .project-detail-desc {
        font-size: 0.95rem;
        margin-bottom: 2rem;
        text-align: left;
        width: 100%;
    }
}
.project-detail-skills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.project-detail-skills code {
  font-size: 0.7rem;
  background: var(--highlight-color);
  padding: 0.13rem 0.4rem;
  font-family: var(--code-font-family);
}

@media (max-width: 480px) {
    .project-detail-skills {
        justify-content: center;
    }
    .project-detail-skills code {
        font-size: 0.7rem;
        margin-bottom: 0;
    }
}

.project-detail-skills code:hover {
  background: var(--accent-color);
  color: var(--background-color);
  cursor: pointer;
}

/* Float-Fade-In Animation */
.float-fade-in {
  opacity: 0;
  transform: translateY(40px);
  animation: floatFadeIn 0.8s cubic-bezier(0.33,1,0.68,1) forwards;
  animation-play-state: paused;
}
.float-fade-in.float-fade-in-visible {
  animation-play-state: running;
}
@keyframes floatFadeIn {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Section Title */
.section-title {
  text-align: center;
  font-style: normal;
}

/* Hide on Mobile */
@media (max-width: 480px) {
  .project-detail-title {
    display: none !important;
  }
}


/* Break */


h1:nth-of-type(4) code:first-of-type::after {
    content: '💻';
    position: absolute;
    bottom: -1.8rem;
    left: -2rem;
    font-size: var(--emoji-font-size);
    transform: rotate(-33deg);
    z-index: 99;
    transition: transform 0.3s ease;
    cursor: pointer;
}

@media (max-width: 768px) {
    h1:nth-of-type(4) code:first-of-type::after {
        font-size: 1.75rem;
        bottom: -1.5rem;
        left: -1.5rem;
    }
}

@media (max-width: 480px) {
    h1:nth-of-type(4) code:first-of-type::after {
        font-size: 1.25rem;
        bottom: -1.2rem;
        left: -1.2rem;
    }
}

h1:nth-of-type(4) code:first-of-type:hover::after {
    animation: squiggle-laptop 0.5s ease-in-out infinite;
}

h1:nth-of-type(4) code:nth-of-type(2)::before {
    content: '👀';
    position: absolute;
    top: -2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: var(--emoji-font-size);
    z-index: 99;
    transition: transform 0.3s ease;
    cursor: pointer;
    transform-origin: center;
}

@media (max-width: 768px) {
    h1:nth-of-type(4) code:nth-of-type(2)::before {
        font-size: 1.75rem;
        top: -1.5rem;
    }
}

@media (max-width: 480px) {
    h1:nth-of-type(4) code:nth-of-type(2)::before {
        font-size: 1.25rem;
        top: -1.2rem;
    }
}

h1:nth-of-type(4) code:nth-of-type(2):hover::before {
    animation: squiggle-eyes 0.5s ease-in-out infinite;
}

h1:nth-of-type(5) code::after {
    content: '📈';
    position: absolute;
    top: 50%;
    right: -2.1rem;
    transform: translateY(-50%);
    font-size: calc(var(--emoji-font-size)-5rem);
    z-index: 99;
    transition: transform 0.3s ease;
    cursor: pointer;
}

@media (max-width: 768px) {
    h1:nth-of-type(5) code::after {
        font-size: 1.25rem;
        right: -1.6rem;
    }
}

@media (max-width: 480px) {
    h1:nth-of-type(5) code::after {
        font-size: 1.2rem;
        right: -1.3rem;
    }
}

h1:nth-of-type(5) code:hover::after {
    animation: squiggle-chart 0.5s ease-in-out infinite;
}

h1:first-of-type em:first-of-type {
    display: inline-block;
    transform: rotate(-28deg);
    transition: transform 0.3s ease;
    cursor: pointer;
}

h1:first-of-type em:first-of-type:hover {
    animation: squiggle 0.5s ease-in-out infinite;
}

h1:first-of-type em:nth-of-type(2) {
    position: relative;
    cursor: pointer;
    transition: color 0.5s ease;
    overflow: hidden;
}

h1:first-of-type em:nth-of-type(2)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background-color: var(--text-color);
    transition: width 0.2s ease;
    z-index: -1;
}

h1:first-of-type em:nth-of-type(2):hover::before {
    width: 100%;
}

h1:first-of-type em:nth-of-type(2):hover {
    color: var(--background-color);
}

h1:first-of-type em:nth-of-type(2):hover::after {
    content: var(--tooltip-content);
    position: fixed;
    background-color: var(--background-color);
    border: 2px solid var(--text-color);
    color: var(--text-color);
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
    font-family: var(--code-font-family);
    font-weight: 300;
    left: var(--mouse-x, 0);
    top: var(--mouse-y, 0);
    white-space: nowrap;
    transform: translate(-2rem, -7rem);
}




@keyframes squiggle {
    0%, 100% {
        transform: rotate(-28deg);
    }
    25% {
        transform: rotate(-33deg);
    }
    75% {
        transform: rotate(-23deg);
    }
}

@keyframes squiggle-laptop {
    0%, 100% {
        transform: rotate(-33deg);
    }
    25% {
        transform: rotate(-38deg);
    }
    75% {
        transform: rotate(-28deg);
    }
}

@keyframes squiggle-eyes {
    0%, 100% {
        transform: translateX(-50%);
    }
    25% {
        transform: translateX(-50%) rotate(5deg);
    }
    75% {
        transform: translateX(-50%) rotate(-5deg);
    }
}

@keyframes squiggle-chart {
    0%, 100% {
        transform: translateY(-50%);
    }
    25% {
        transform: translateY(-50%) scale(1.1);
    }
    75% {
        transform: translateY(-50%) scale(0.9);
    }
}

@media (max-width: 768px) {
  h1, h2 { font-size: 1.25rem; }
  h2 { margin-bottom: 1.5rem; }
  h3 { font-size: 1.1rem; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.3rem; margin: 0; margin-bottom: 0.8rem; }
  h2 { font-size: 1.25rem;}
  h3 { font-size: 1rem; }
  .project-box {
    font-size: 1.1rem;
  }
  code { font-size: 0.9rem; margin: 0; margin-bottom: 0.8rem;}
  :root {
    --emoji-font-size: 2rem;
  }
}

/* Scroll Indicator */
.scroll-indicator {
  width: 100vw;
  height: 1rem;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  background-color: var(--background-color);
}
.scroll-indicator::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: var(--scroll-width);
  height: 100%;
  background-image: linear-gradient(to right, var(--accent-color), var(--highlight-color));
  transition: width 0.1s ease-out;
}

/* Fixed seal box bottom right */
.seal-box {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  z-index: 1000;
  user-select: none;
  pointer-events: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--text-color);
  border: 1px solid var(--text-color);
}
.seal-box:hover {
  transition: 0.1s  ease;
  background-color: var(--background-color);
  .seal-link {
    color: var(--text-color);
  }
}



.seal-link {
  color: var(--background-color);
  font-style: normal;
  text-decoration: none;
  font-size: 0.8rem;
  font-family: var(--code-font-family);
}

.seal-link:hover {
  text-decoration: underline;
}

#cv {
  margin-bottom: 25vh;
}

@media (max-width: 480px) {
  .seal-box {
    position: relative !important;
    bottom: unset !important;
    right: unset !important;
    left: unset !important;
    transform: none !important;
    width: calc(100% - 2rem);
    margin-top: 2rem;
    font-size: 0.8rem;
    padding: 0.7rem;
  }
  #cv {
    margin-bottom: 0;
  }
}

.seal-link sup {
  color: inherit;
  /* transition: color 0.2s; */
}

.skills-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
  gap: 0.7rem;
}

.skills-container > code {
  font-size: 1rem;
  }

  @media (max-width: 480px) {
    .skills-container {
      justify-content: space-between;
    }
    .skills-container > code {
      margin-bottom: 0rem;
      
    }
}