/* Global Styles */

:root {
  --scale-factor: 0.75;
}

* {
  cursor: auto !important;
}

.user-select-none {
  user-select: none;
}

body:has(.monitor) {
  overflow: hidden;  /* disables scrolling on main page */
}

body {
  margin: 0;
  background-color: #0e0e1e;
  font-family: "Source Code Pro", monospace;
  font-optical-sizing: auto;
  font-weight: 800;
  font-style: normal;
  color: #fceaff;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-image: url('Images/black.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  position: relative;
  color-scheme: only light;
  image-rendering: auto;
}

h1, h2, h3, h4, h5, h6 {
  text-align: center;
}

/* Inside monitor: hide system cursor */
.monitor * {
  cursor: none !important;
}

.monitor-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 120%;
  max-width: 1000px;
  aspect-ratio: 4 / 3;
  overflow: visible;
}

.monitor {
  margin-top: -10%;
  position: relative;
  background-color: #1a1a2e;
  border-radius: 20px;
  width: 90%;
  max-width: 900px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.monitor-inner {
  position: relative;
  padding: 30px;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  z-index: 1;
}

.corner-icons {
  position: absolute;
  top: 50px;
  right: 50px;
  width: 8%;
  height: auto;
  z-index: 20;
  pointer-events: none; 
}

.monitor > *:not(.wallpaper) {
  position: relative;
  z-index: 1;
}

.wallpaper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.monitor-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45.8%);
  width: 300%;
  height: 300%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.notepad-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -45.8%);
  width: 300%;
  height: 300%;
  background: url('Images/notepad.png') no-repeat center center;
  background-size: contain;
  z-index: 5;
  pointer-events: none; /* let mouse pass through background */
}

.notepad-menu {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10%;
  height: auto;
  transform: translate(-250%, 0%); 
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-evenly;
  z-index: 20;
  pointer-events: auto;
}

.notepad-menu button {
  width: 200px;
  height: 60px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  background-color: transparent;
  cursor: pointer;
  margin: 10px 0;
  transition: transform 0.2s ease;
  opacity: 0.7;
  cursor: pointer !important;
}

/* Default button Images */
.btn-about {
  background-image: url('Images/button-about.png');
}
.btn-projects {
  background-image: url('Images/button-projects.png');
}
.btn-archive {
  background-image: url('Images/button-archive.png');
}
.btn-extras {
  background-image: url('Images/button-buttons.png');
}

/* Hover states */
.btn-about:hover,
.btn-about.active {
  animation: aboutHoverAnim 0.6s steps(2) infinite;
}
.btn-projects:hover,
.btn-projects.active {
  animation: projectsHoverAnim 0.6s steps(2) infinite;
}
.btn-archive:hover, 
.btn-archive.active {
  animation: archiveHoverAnim 0.6s steps(2) infinite;
}
.btn-extras:hover, 
.btn-extras.active {
  animation: extrasHoverAnim 0.6s steps(2) infinite;
}

/* Keyframe animations for each button */
@keyframes aboutHoverAnim {
  0%, 49% {
    background-image: url('Images/button-about-hover.png');
  }
  50%, 100% {
    background-image: url('Images/button-about-hover2.png');
  }
}

@keyframes projectsHoverAnim {
  0%, 49% {
    background-image: url('Images/button-projects-hover.png');
  }
  50%, 100% {
    background-image: url('Images/button-projects-hover2.png');
  }
}

@keyframes archiveHoverAnim {
  0%, 49% {
    background-image: url('Images/button-archive-hover.png');
  }
  50%, 100% {
    background-image: url('Images/button-archive-hover2.png');
  }
}

@keyframes extrasHoverAnim {
  0%, 49% {
    background-image: url('Images/button-buttons-hover.png');
  }
  50%, 100% {
    background-image: url('Images/button-buttons-hover2.png');
  }
}

.flame-overlay {
  position: absolute;
  top: -19%;
  left: 128.5%;
  transform: translate(-50%, -45.7%);
  width: 15%;
  height: 15%;
  object-fit: cover;
  mix-blend-mode: screen;
  z-index: 1;
  pointer-events: none;
  
  /* Fix for PiP button and controls */
  -webkit-playsinline: true;

}

.cursor-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
  z-index: 10000;
}

#custom-cursor {
  position: absolute;
  width: 70px;
  height: 70px;
  pointer-events: none;
  z-index: 1000;
  transition: none; /* Remove transition to prevent animation lag */
  opacity: 1;
  will-change: transform; /* Hint for browser to optimize */
}

.subtabs {
  display: flex;
  justify-content: space-around;
  margin-top: 20px;
  border-bottom: 2px solid #fcb1ff;
}

.subtab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  cursor: pointer;
  font-size: 1em;
  transition: background 0.3s;
}

.subtab.active {
  background-color: #1a1a2e;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  box-shadow: 0 -3px 10px rgba(0, 0, 0, 0.2);
  transform: translateZ(0); /* Force GPU acceleration */
  will-change: transform; /* Hint for browser to optimize */
}

.subtab-content {
  display: none;
  animation: fadeIn 0.4s;
}

.subtab-content.active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.tab-content {
  display: none;
  animation: fadeIn 0.4s;
}

.tab-content.active {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.tab-button {
  background: transparent;
  border: 10px solid #ffbbec; 
  background: rgb(175, 76, 162);
  padding: 14px 24px;        
  display: inline-block;
  image-rendering: pixelated;
  border-radius: 12px;      
  font-weight: 800;          
  color: #fceaff;
  font-family: "Source Code Pro", monospace;
  text-align: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.12s;
  font-size: 2.5rem;           
}

.tab-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 18px rgba(255, 187, 236, 0.12);
  background-color: rgb(255, 187, 236);
}

.tab-button:active {
  transform: translateY(0);
  box-shadow: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.floating-image {
  position: absolute; /* Or use fixed if you want it to stay in place while scrolling */
  top: 90px; /* Adjust the vertical position */
  right: 80px; /* Adjust the horizontal position */
  z-index: 10; /* Ensure it appears above other elements */
}

@media (max-width: 768px) {
  .floating-image {
    display: none; /* Hide the floating image on mobile devices */
  }

  .tab-button {
    font-size: 1.3rem;
  }
}

.floating-image img {
  height: 130px;
  image-rendering: pixelated;
}

.section {
  background-color: #2a2a4f;
  border-radius: 10px;
  margin: 10px 0;
  padding: 20px;
  border: 2px solid #ffbbec;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.grid-section {
  background-color: #2a2a4f;
  border-radius: 10px;
  margin: 10px 0;
  padding: 40px;
  border: 2px solid #ffbbec;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  height: calc(100% - 40px); /* Subtract margin to fit within monitor */
  box-sizing: border-box;
}


.section h2 {
  color: #ffaaff;
  font-size: 1.6em;
}

.section p {
  color: #d5c0ff;
  font-size: 1em;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 30px 30px;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: #fcb1ff #1a1a2e;
  margin-bottom: 10px;
  max-height: 100%; /* Prevents unnecessary stretching */
  min-height: auto; /* Ensures it adjusts to content */
  box-sizing: border-box; /* Ensures padding doesn't affect size */
}

.projects-grid::-webkit-scrollbar {
  width: 8px;
}

.projects-grid::-webkit-scrollbar-track {
  background: #1a1a2e;
  border-radius: 10px;
}

.projects-grid::-webkit-scrollbar-thumb {
  background-color: #fcb1ff;
  border-radius: 10px;
  border: 2px solid #1a1a2e;
}

.project-card {
  display: flex;
  background-color: #1a1a2e;
  border: 2px dashed #ffbbec;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  transform: translateZ(0); /* Force GPU acceleration */
  will-change: transform; /* Hint for browser to optimize */
}

.project-card:hover {
  transform: scale(1.09);
  box-shadow: 0 0 15px #ffd6ff, 0 0 30px #ff8ee0;
  z-index: 2;
}

.project-card img {
  width: 100%;
  border-radius: 5px;
  margin-bottom: 12px;
  object-fit: cover;
  aspect-ratio: 1/1; /* Make thumbnails square */
  max-width: 100%;
}

.project-card p {
  margin: 0.5em 0 0 0;
  text-align: center;
  word-wrap: break-word;
  overflow-wrap: break-word;
  flex-grow: 1;
  font-size: 1.2em;
}

.links-box h2 {
  color: #ffaaff;
  text-align: center;
  margin-bottom: 20px;
  font-size: 1.6em;
}

.links-icons {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  align-items: center;
}

.links-icons img {
  width: 60px;
  height: 60px;
  transition: transform 0.3s ease;
}

.links-icons img:hover {
  transform: scale(1.2);
}

.footer {
  text-align: center;
  margin-top: 10px;
  font-size: 0.9em;
  color: #bbb;
}

.cat-wrapper {
  position: absolute;
  bottom: -33px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.footer img {
  width: 100px;
  height: auto;
  image-rendering: pixelated;
}

a {
  color: #eabfff;
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #ffd6ff;
  text-decoration: underline;
}

a:visited {
  color: #c3b3ff;
}

a:active {
  color: #ffaad4;
}

.arrow-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 90px;
  height: 90px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  text-indent: -9999px;
  cursor: pointer;
  z-index: 10;
}

.left {
  left: -15px;
  background-image: url('Images/ArrowLeft.png');
}

.right {
  right: -15px;
  background-image: url('Images/ArrowRight.png');
}

#physical-mouse {
  position: absolute;
  width: 300%;
  height: 300%;
  pointer-events: none;
  z-index: 10000;
  transition: opacity 0.1s, transform 0.1s;
  image-rendering: pixelated;
  transform: translate(0%, 4%) translateZ(0); 
  will-change: transform;
}

body:has(.monitor) {
  margin: 0;
  padding: 0;
  background-color: #0e0e1e;

  /* Zoom level */
  transform: scale(var(--scale-factor));
  transform-origin: top center;

  /* These fix the shift and ensure correct centering */
  width: 100vw;
  height: 100vh;

  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 7%;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
}

.button-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* Center the buttons */
  gap: 15px;
  margin: 20px 0;
}

.button-container a img {
  height: 60px; /* Slightly bigger than the usual 31px */
  width: auto;
  image-rendering: pixelated;
}

.button-container a img:hover {
  transform: scale(1.09); /*  zoom on hover */
}

.button-deco {
  height: 60px;
  vertical-align: middle;
  margin: 0 5px;
}

.button-deco.arrow {
  transform: rotate(-90deg);
  height: 40px;
}

.my-button-section {
  border: 3px dashed #ffaaff;
  padding: 20px;
  border-radius: 12px;
  margin: 20px auto;
  max-width: 300px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}



/* Desk clickable areas - relative to monitor-bg */
.desk-clickable-areas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* Above background but below other elements */
  pointer-events: none; /* Let events pass through by default */
}

.desk-click-box {
  position: absolute;
  display: block;
  cursor: pointer !important;
  pointer-events: auto; /* Capture events on these elements */
  background-color: transparent;
  /*border: 2px dashed #ff0000;  /* for visibility during development */
}

/* Example positioning for three areas - adjust as needed */
#desk-area1 {
  top: 13%;
  left: -80%;
  width: 50%;
  height: 80%;
}

#desk-area2 {
  top: 85%;
  right: -17%;
  width: 10%;
  height: 20%;
}

#desk-area3 {
  bottom: -5%;
  left: 163%;
  transform: translateX(-50%);
  width: 50%;
  height: 80%;
}

#desk-area4 {
  top: 108%;
  right: -7%;
  width: 10%;
  height: 18%;
}

#desk-area5 {
  top: 108%;
  right: 7%;
  width: 10%;
  height: 15%;
}

#desk-area6 {
  top: -70%;
  right: 65%;
  width: 45%;
  height: 40%;
}

#key-up {
  top: 148%;
  left: 65%;
  width: 7%;
  height: 7%;
}

#key-down {
  top: 156%;
  left: 65.5%;
  width: 7%;
  height: 7%;
}

#key-left {
  top: 156%;
  left: 58%;
  width: 7%;
  height: 7%;
}

#key-right {
  top: 156%;
  left: 73%;
  width: 7%;
  height: 7%;
}

#key-b {
  top: 148%;
  left: -10%;
  width: 7%;
  height: 7%;
}

#key-a {
  top: 140%;
  left: -43%;
  width: 7%;
  height: 7%;
}

/* Project category colors */
.project-card[data-category="realtime"] {
  border-color: #66ff99 !important;  /* Green for realtime */
}

.project-card[data-category="vfx"] {
  border-color: #ff9966 !important;  /* Orange for live action VFX */
}

.project-card[data-category="fullcg"] {
  border-color: #6699ff !important;  /* Blue for full CG */
}

/* Color key styling - now positioned below the grid */
.color-key {
  position: absolute;
  bottom: 65px; /* Position just below the subtabs */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 25px;
  padding: 8px 15px; /* Smaller vertical padding */
  background-color: rgba(26, 26, 46, 0.9);
  border-radius: 8px;
  border: 2px solid #ffbbec;
  width: fit-content;
  z-index: 10;
  font-size: 0.85em; /* Slightly smaller to fit better */
}

.key-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9em;
  color: #d5c0ff;
}

.key-dot {
  width: 15px;
  height: 15px;
  border-radius: 3px;
  border: 2px dashed;
}

.key-dot.realtime {
  border-color: #66ff99;
}

.key-dot.vfx {
  border-color: #ff9966;
}

.key-dot.fullcg {
  border-color: #6699ff;
}

/* Password protection section */
#password-protect {
  background-color: #2a2a4f;
  border-radius: 10px;
  padding: 20px;
  margin-top: 20px;
  border: 2px solid #ffbbec;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#password-protect label {
  color: #fceaff;
  font-size: 1.2em;
  display: block;
  margin-bottom: 10px;
}

#password-protect input {
  padding: 10px;
  margin-top: 10px;
  margin-bottom: 10px;
  border-radius: 5px;
  border: 1px solid #ddd;
  font-size: 1.1em;
  width: 100%;
  max-width: 300px;
  background-color: #1a1a2e;
  color: #fceaff;
}

#password-protect button {
  padding: 10px 20px;
  background-color: #ffbbec;
  color: #1a1a2e;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  width: 100%;
  max-width: 300px;
  font-size: 1.1em;
  margin-top: 10px;
  transition: background-color 0.2s ease;
}

#password-protect button:hover {
  background-color: #fcb1ff;
}

#password-protect p {
  color: red;
  font-size: 1em;
  margin-top: 10px;
}

/* Secret content section */
#secret-content {
  background-color: #2a2a4f;
  padding: 20px;
  border-radius: 10px;
  margin-top: 20px;
  border: 2px solid #ffbbec;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#secret-content p {
  color: #fceaff;
  font-size: 1.2em;
  margin-bottom: 20px;
}

/* Secret link button */
#secret-link-btn {
  padding: 15px 30px;
  background-color: #ffbbec;
  color: #1a1a2e;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  width: 500%;
  max-width: 500px;
  font-size: 1.5em;
  font-weight: bold;
  transition: background-color 0.2s ease;
  margin-top: 10px;
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translate(-50%, 0%);
}

#secret-link-btn:hover {
  background-color: #ff8eb0;
}
