/* ===========================
   Color scheme
   =========================== */

:root {
  --true-white: #ffffff;
  --white: #fafafa;
  --light-gray: #f2f2f2;
  --gray: #666666;
  --dark-gray: #474747;
  --true-black: #000000;
  --black: #050505;
}

/* ===========================
   Typography
   =========================== */

@font-face {
  font-family: "Nohemi";
  src: url("fonts/Nohemi-VF.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
}

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

@font-face {
  font-family: "Source Code Pro";
  src: url("fonts/SourceCodePro-VF.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
}

:root {
  --font-nohemi: "Nohemi", serif;
  --font-sarabun: "Sarabun", sans-serif;
  --font-source-code-pro: "Source Code Pro", monospace;

  --font-size-h1: 250px;
  --container-padding: 48px;
}

@media (max-width: 1120px) {
  :root {
    --font-size-h1: 180px;
  }
}

@media (max-width: 860px) {
  :root {
    --font-size-h1: 20vw;
    --container-padding: 40px;
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 36px;
  }
}

@media (max-width: 580px) {
  :root {
    --container-padding: 24px;
  }
}

@media (max-width: 450px) {
  :root {
    --container-padding: 16px;
  }
}

/* ===========================
   Reset
   =========================== */

* {
  box-sizing: border-box;
}

html,
body {
  padding: 0;
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6,
p {
  margin: 0;
  font-weight: normal;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===========================
   Global
   =========================== */

body {
  overflow-x: hidden;
  background-color: var(--white);
}

body.projects-page {
  background-color: var(--black);
}

body.projects-page .page-container {
  background-color: transparent;
}

body:has(#loading-screen:not(.anim-complete)) {
  overflow: hidden;
}

*::selection {
  background-color: var(--black);
  color: var(--white);
}

/* ===========================
   Custom cursor
   =========================== */

html,
html * {
  cursor: none;
}

#cursor {
  position: fixed;
  width: 16px;
  height: 16px;
  border-radius: 16px;
  pointer-events: none;
  background-color: var(--white);
  mix-blend-mode: difference;
  scale: 0;
  transition: 0.3s scale;
  z-index: 100;
}

body.cursor-ready #cursor {
  scale: 1;
}

@media (hover: none) and (pointer: coarse) {

  html,
  html * {
    cursor: auto;
  }

  #cursor {
    display: none;
  }

  /* Disable grab cursors on all drag handles */
  .hub-portrait-header,
  .hub-portrait-header:active,
  .hub-terminal-header,
  .hub-terminal-header:active,
  .window-drag-handle,
  .window-drag-handle:active,
  .app-window-header,
  .app-window-header:active {
    cursor: default;
  }
}

/* ===========================
   Loading screen
   =========================== */

#loading-screen {
  position: fixed;
  width: 100%;
  height: 100dvh;
  opacity: 1;
  background-color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: 1.5s opacity ease-in;
}

#loading-screen.hide {
  opacity: 0;
  pointer-events: none;
}

#loading-screen.anim-complete {
  display: none;
}

#loading-screen .percentage {
  position: absolute;
  left: -6px;
  bottom: -58px;
  color: var(--white);
  display: flex;
  font-family: var(--font-nohemi);
  font-size: var(--font-size-h1);
  font-weight: 900;
  line-height: 100%;
  letter-spacing: -3px;
  user-select: none;
}

@media (max-width: 1120px) {
  #loading-screen .percentage {
    font-size: 180px;
    letter-spacing: -2.4px;
    left: -4px;
    bottom: -42px;
  }
}

@media (max-width: 860px) {
  #loading-screen .percentage {
    font-size: 20vw;
    letter-spacing: -0.4vw;
    left: -0.5vw;
    bottom: -4.8vw;
  }
}

/* ===========================
   Jumbotron (Landing)
   =========================== */

#jumbotron {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  background-color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  /* Layer 2: sit on top of the navigation-hub */
}

#jumbotron .title {
  position: absolute;
  font-family: var(--font-nohemi);
  font-size: var(--font-size-h1);
  font-weight: 900;
  line-height: 100%;
  letter-spacing: -3px;
  z-index: 2;
  pointer-events: none;
  user-select: none;
}

#jumbotron .title.top-left {
  top: -24px;
  left: -6px;
}

#jumbotron .title.bottom-right {
  bottom: -58px;
  right: -2px;
}

@media (max-width: 1120px) {
  #jumbotron .title {
    font-size: 180px;
    letter-spacing: -2.4px;
  }

  #jumbotron .title.top-left {
    top: -18px;
    left: -4px;
  }

  #jumbotron .title.bottom-right {
    bottom: -42px;
    right: -2px;
  }
}

@media (max-width: 860px) {
  #jumbotron .title {
    font-size: 20vw;
    letter-spacing: -0.4vw;
  }

  #jumbotron .title.top-left {
    top: -2vw;
    left: -0.5vw;
  }

  #jumbotron .title.bottom-right {
    bottom: -4.8vw;
    right: 0;
  }
}

@media (max-width: 580px) {
  #jumbotron .title {
    font-size: 27vw;
    letter-spacing: -0.6vw;
  }

  #jumbotron .title.top-left {
    top: -3vw;
    left: -1vw;
  }

  #jumbotron .title.bottom-right {
    bottom: -6.5vw;
    right: -1vw;
  }
}


/* Description */

#jumbotron .description {
  position: absolute;
  top: 44px;
  right: var(--container-padding);
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  z-index: 3;

  font-family: var(--font-sarabun);
  font-size: 16px;
  font-weight: 400;
  line-height: 150%;
  text-align: right;
}

#jumbotron .description>* {
  background-color: var(--white);
  padding: 0 8px;
}

#jumbotron .description a {
  text-decoration: underline;
}

@media (max-width: 768px) {
  #jumbotron .description {
    top: auto;
    bottom: 150px;
    right: var(--container-padding);
    left: var(--container-padding);
    align-items: flex-start;
    text-align: left;
    font-size: 18px;
  }
}

@media (max-width: 580px) {
  #jumbotron .description {
    font-size: 16px;
    bottom: 130px;
    gap: 2px;
  }
}

@media (max-width: 450px) {
  #jumbotron .description {
    font-size: 15px;
    bottom: 120px;
  }
}

/* Scroll indicator */

#jumbotron .scroll-down {
  position: absolute;
  bottom: 40px;
  left: var(--container-padding);
  height: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--white);
  border-radius: 16px;
  border: 2px solid var(--black);
  padding: 4px 4.5px;
  z-index: 3;

  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
  transition: 1s opacity, 1s transform;
}

#jumbotron .scroll-down.hidden {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

#jumbotron .scroll-down .scroll-wheel {
  width: 4px;
  height: 10px;
  border-radius: 12px;
  background-color: var(--black);
  animation: scroll-anim 2s infinite ease-in-out;
}

@keyframes scroll-anim {
  0% {
    transform: translateY(0);
    opacity: 0;
  }

  15% {
    transform: translateY(0);
  }

  20% {
    opacity: 1;
  }

  60% {
    opacity: 1;
    transform: translateY(16px);
  }

  75% {
    transform: translateY(16px);
    opacity: 0;
  }

  100% {
    transform: translateY(0);
    opacity: 0;
  }
}

/* ASCII art container */

#ascii-art {
  width: 100%;
  height: 100%;
  user-select: none;
  z-index: 1;
}

/* Override AsciiEffect renderer defaults */
#ascii-art table {
  letter-spacing: -0.6px !important;
  font-family: var(--font-source-code-pro) !important;
}

/* ===========================
   Scroll & Transition Structure
   =========================== */

#scrollable-content {
  position: relative;
  width: 100%;
  z-index: 10;
  pointer-events: none;
  /* Let clicks pass through to jumbotron if needed */
}

.scroll-spacer {
  height: 200vh;
  /* Spacer to allow jumbotron zoom animation */
}

/* ===========================
   Navigation Hub Section
   =========================== */

#navigation-hub {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px var(--container-padding);
  background-color: var(--white);
  box-sizing: border-box;
  pointer-events: none;
  /* Inactive by default so it doesn't hijack pointer events */
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
  overflow: hidden;
  z-index: 1;
  /* Layer 1: sit directly behind jumbotron */
}

#navigation-hub.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  /* Active once visible */
}

#dither-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

#dither-canvas2 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

#dither-canvas3 {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.hub-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: center;
  gap: 30px;
  width: 100%;
  max-width: 1300px;
  box-sizing: border-box;
}

.hub-portrait {
  flex-shrink: 0;
  width: 380px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--dark-gray);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  background-color: var(--true-black);
  touch-action: none;
  /* Prevents scrolling when dragging */
  transform: translate(0px, 0px);
  /* Drag offset */
  will-change: transform;
}

.hub-portrait-header {
  background-color: #1a1a1a;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--dark-gray);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.hub-portrait-header:active {
  cursor: grabbing;
}

.hub-portrait-header .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.hub-portrait-header .dot:nth-child(1) {
  background-color: #ff5f56;
}

.hub-portrait-header .dot:nth-child(2) {
  background-color: #ffbd2e;
}

.hub-portrait-header .dot:nth-child(3) {
  background-color: #27c93f;
}

.hub-portrait-header .title {
  color: var(--gray);
  font-size: 13px;
  margin-left: auto;
  margin-right: auto;
  font-family: var(--font-source-code-pro);
}

.hub-portrait-body {
  width: 100%;
  height: 500px;
  overflow: hidden;
}

.hub-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  /* Mirror image horizontally */
}

.hub-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 700px;
  background-color: var(--true-black);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--dark-gray);
  font-family: var(--font-source-code-pro);
  touch-action: none;
  /* Prevents scrolling when dragging on mobile */
  transform: translate(0px, 0px);
  /* Used for dragging offsets */
  will-change: transform;
}

/* Terminal Header */

.hub-terminal-header {
  background-color: #1a1a1a;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--dark-gray);
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}

.hub-terminal-header:active {
  cursor: grabbing;
}

.hub-terminal-header .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.hub-terminal-header .dot:nth-child(1) {
  background-color: #ff5f56;
}

.hub-terminal-header .dot:nth-child(2) {
  background-color: #ffbd2e;
}

.hub-terminal-header .dot:nth-child(3) {
  background-color: #27c93f;
}

.hub-terminal-header .title {
  color: var(--gray);
  font-size: 13px;
  margin-left: auto;
  margin-right: auto;
}

/* Terminal Body */

.hub-terminal-body {
  padding: 24px;
  color: #39ff14;
  /* Matrix neon green */
}

.hub-terminal-body .prompt {
  color: var(--light-gray);
  font-size: 15px;
  margin-bottom: 24px;
}

.hub-menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hub-item {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #39ff14;
  font-size: clamp(16px, 3vw, 20px);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

.hub-item::after {
  content: '';
  position: absolute;
  left: 0;
  width: 4px;
  height: 0;
  background-color: #39ff14;
  transition: height 0.3s;
}

.hub-item .num {
  color: var(--gray);
  margin-right: 16px;
  font-weight: bold;
}

.hub-item .label {
  font-weight: 500;
  color: var(--white);
  transition: color 0.3s;
}

.hub-item .arrow {
  margin-left: auto;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s;
}

/* Hover effects */
.hub-item:hover {
  background-color: rgba(57, 255, 20, 0.05);
  border-color: rgba(57, 255, 20, 0.2);
}

.hub-item:hover::after {
  height: 100%;
}

.hub-item:hover .label {
  color: #39ff14;
}

.hub-item:hover .arrow {
  opacity: 1;
  transform: translateX(0);
}

/* ===========================
   Socials Window Styles
   =========================== */

.socials-window {
  max-width: 320px;
}

.social-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.social-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--white);
  font-size: 15px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
}

.social-item::after {
  content: '';
  position: absolute;
  left: 0;
  width: 4px;
  height: 0;
  background-color: #39ff14;
  transition: height 0.3s;
}

.social-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--gray);
  transition: color 0.3s;
}

.social-label {
  font-weight: 500;
  transition: color 0.3s;
}

/* Hover state for social item */
.social-item:hover {
  background-color: rgba(57, 255, 20, 0.05);
  border-color: rgba(57, 255, 20, 0.2);
}

.social-item:hover::after {
  height: 100%;
}

.social-item:hover .social-icon {
  color: #39ff14;
}

.social-item:hover .social-label {
  color: #39ff14;
}




/* ===========================
   Page Transition Overlay
   =========================== */

#transition-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--black);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease-in-out;
}

#transition-screen.active {
  opacity: 1;
  pointer-events: auto;
}

#transition-ascii {
  width: 100%;
  height: 100%;
}

#transition-ascii table {
  letter-spacing: -0.6px !important;
  font-family: var(--font-source-code-pro) !important;
}

/* ===========================
   Second-Level Page Containers
   =========================== */

.page-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--white);
  padding: var(--container-padding);
  box-sizing: border-box;
}

.draggable-window {
  position: relative;
  width: 100%;
  background-color: var(--true-black);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  touch-action: none;
  transform: translate(0px, 0px);
  will-change: transform;
}

.window-drag-handle {
  cursor: grab;
  user-select: none;
}

.window-drag-handle:active {
  cursor: grabbing;
}

/* ===========================
   Projects Page Layout
   =========================== */

.projects-layout {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 50px;
  width: 100%;
  max-width: 1300px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 40px var(--container-padding);
  box-sizing: border-box;
}

/* Left: PC Mockup */
.pc-mockup-wrapper {
  flex: 1.2;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pc-mockup {
  position: relative;
  width: 80%;
  max-width: 460px;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.15));
}

.pc-mockup-img {
  width: 100%;
  height: auto;
  display: block;
  transition: opacity 0.25s ease-in-out;
}

/* Right: macOS App Window */
.app-window {
  flex: 1;
  max-width: 500px;
  width: 100%;
  height: 600px;
  max-height: 85vh;
  background-color: var(--white);
  border: 1px solid var(--gray);
  border-radius: 12px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--black);
  display: flex;
  flex-direction: column;
}

.app-window-header {
  background-color: #f3f3f3;
  border-bottom: 1px solid #e2e2e2;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  position: relative;
  cursor: grab;
}

.app-window-header:active {
  cursor: grabbing;
}

.window-dots {
  display: flex;
  gap: 8px;
}

.window-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.window-dots .dot.red {
  background-color: #ff5f56;
}

.window-dots .dot.yellow {
  background-color: #ffbd2e;
}

.window-dots .dot.green {
  background-color: #27c93f;
}

.app-title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  color: var(--dark-gray);
  user-select: none;
}

.app-window-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 1;
  overflow: hidden;
}

/* Inline Selector and Nav wrapper */
.selector-nav-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.project-selector-container {
  position: relative;
  flex: 1;
}

.project-select-btn {
  width: 100%;
  height: 44px;
  background-color: var(--white);
  border: 1px solid var(--gray);
  border-radius: 8px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.project-select-btn:hover {
  border-color: var(--dark-gray);
}

#selected-project-title {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-dropdown-list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  background-color: var(--white);
  border: 1px solid var(--gray);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 6px 0;
  margin: 0;
  list-style: none;
  z-index: 10;
  max-height: 250px;
  overflow-y: auto;
  display: none;
  box-sizing: border-box;
}

.project-dropdown-list.open {
  display: block;
}

.project-dropdown-item {
  padding: 10px 16px;
  font-size: 13px;
  color: var(--dark-gray);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.project-dropdown-item:hover {
  background-color: #f5f5f7;
  color: var(--black);
}

.project-dropdown-item.active {
  background-color: #0071e3;
  color: var(--white);
  font-weight: 500;
}

/* Nav Bar Controls */
.nav-arrow-btn {
  background-color: var(--white);
  border: 1px solid var(--gray);
  font-size: 18px;
  color: var(--dark-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
  box-sizing: border-box;
}

.nav-arrow-btn:hover {
  background-color: #f5f5f7;
  border-color: var(--dark-gray);
  color: var(--black);
}

.project-counter {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  margin-right: 4px;
}

/* Project details */
.project-details-view {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
}

/* Custom scrollbar for project details */
.project-details-view::-webkit-scrollbar {
  width: 6px;
}

.project-details-view::-webkit-scrollbar-track {
  background: transparent;
}

.project-details-view::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}

.project-details-view::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.3);
}

.project-name {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--black);
  margin-bottom: -6px;
}

.project-tag {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: #0071e3;
  margin-bottom: -40px;
}

.project-desc-wrapper {
  font-size: 14px;
  line-height: 1.5;
  color: var(--dark-gray);
  white-space: pre-wrap;
  margin-bottom: -40px;
}

.project-meta-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 10px;
}

.meta-section h4 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--dark-gray);
  margin-bottom: 6px;
}

.meta-section ul {
  padding-left: 18px;
  margin: 0;
  font-size: 13px;
  color: var(--dark-gray);
}

.meta-section ul li {
  margin-bottom: 4px;
}

.tech-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-tag {
  background-color: #f5f5f7;
  border: 1px solid #e2e2e2;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--dark-gray);
}

.app-footer {
  margin-top: 10px;
  border-top: 1px solid #e2e2e2;
  padding-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.appstore-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--black);
  color: var(--white);
  border: 1px solid var(--black);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.1s;
}

.appstore-btn:hover {
  background-color: var(--white);
  color: var(--black);
  border-color: var(--gray);
}

.appstore-btn:active {
  transform: scale(0.98);
}

.return-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark-gray);
  transition: color 0.2s;
  margin-left: auto;
  /* pushes return-btn to far right when appstore-btn is hidden */
}

.return-btn:hover {
  color: var(--black);
}

.project-link {
  color: #0071e3;
  text-decoration: underline;
  transition: color 0.2s;
  cursor: pointer;
}

.project-link:hover {
  color: var(--black);
}

/* Category Tabs Styling */
.category-tabs-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  padding: 0px 0 0px 0;
  margin-bottom: 0px;
  scrollbar-width: none;
  /* Hide scrollbar for Firefox */
  -ms-overflow-style: none;
  /* Hide scrollbar for IE/Edge */
}

.category-tabs-container::-webkit-scrollbar {
  display: none;
  /* Hide scrollbar for Chrome/Safari */
}

.category-tab {
  background-color: var(--white);
  border: 1px solid var(--gray);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dark-gray);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease-in-out;
  outline: none;
}

.category-tab:hover {
  border-color: var(--dark-gray);
  color: var(--black);
}

.category-tab.active {
  background-color: var(--black);
  border-color: var(--black);
  color: var(--white);
}

/* Dark theme overrides */
.dark-theme .category-tab {
  background-color: #1e1e1e;
  border-color: #333;
  color: #aaa;
}

.dark-theme .category-tab:hover {
  border-color: #555;
  color: #fff;
}

.dark-theme .category-tab.active {
  background-color: #fff;
  border-color: #fff;
  color: #000;
}

/* ===========================
   Responsive Settings
   =========================== */

/* --- Tablet / Small laptop (≤ 1024px) --- */
@media (max-width: 1024px) {
  .hub-wrapper {
    gap: 20px;
    max-width: 100%;
  }

  .hub-portrait {
    width: 300px;
  }

  .hub-portrait-body {
    height: 400px;
  }

  .hub-container {
    max-width: 100%;
  }

  .projects-layout {
    gap: 30px;
  }

  .pc-mockup {
    max-width: 380px;
  }

  .app-window {
    max-width: 460px;
  }
}

/* --- Mobile landscape / Small tablet (≤ 768px) --- */
@media (max-width: 768px) {
  .hub-wrapper {
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    gap: 16px;
    padding: 0;
    width: 100%;
    height: 100%;
  }

  #navigation-hub {
    padding: 24px var(--container-padding);
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
  }

  #jumbotron .scroll-down {
    display: none !important;
  }

  .hub-portrait {
    display: none !important;
  }

  .hub-container {
    width: 100%;
    max-width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .socials-window {
    max-width: 100%;
    flex: 1;
  }

  .hub-terminal-body {
    padding: 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .hub-terminal-body .prompt {
    font-size: 13px;
    margin-bottom: 12px;
  }

  .hub-item {
    padding: 12px 16px;
    font-size: 16px;
  }

  .hub-menu {
    gap: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
  }

  .social-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
  }

  .social-item {
    padding: 10px 14px;
    font-size: 14px;
  }

  /* Projects page */
  .projects-layout {
    flex-direction: column;
    padding: 16px;
    gap: 12px;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    box-sizing: border-box;
  }

  .pc-mockup-wrapper {
    width: 100%;
    order: -1;
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
  }

  .pc-mockup {
    width: 100%;
    max-width: 480px;
  }

  .app-window {
    max-width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    touch-action: auto;
    position: relative;
    z-index: 2;
    margin-top: -120px;
  }

  .app-window-header {
    padding: 10px 16px;
    cursor: default;
  }

  .app-window-header:active {
    cursor: default;
  }

  .app-window-body {
    padding: 16px;
    gap: 14px;
  }

  .selector-nav-wrapper {
    gap: 8px;
  }

  .nav-arrow-btn {
    width: 40px;
    height: 40px;
    font-size: 16px;
    flex-shrink: 0;
  }

  .project-select-btn {
    height: 40px;
    font-size: 13px;
    padding: 0 12px;
  }

  .project-name {
    font-size: 18px;
  }

  .project-tag {
    font-size: 12px;
  }

  .project-desc-wrapper {
    font-size: 13px;
  }

  .app-footer {
    padding-top: 12px;
    flex-wrap: wrap;
    gap: 10px;
  }

  .appstore-btn {
    font-size: 12px;
    padding: 6px 12px;
  }

  .return-btn {
    font-size: 12px;
  }

  /* About / Certificates pages */
  .page-container {
    padding: var(--container-padding);
    align-items: flex-start;
  }

  .page-container .hub-container {
    max-width: 100% !important;
    margin: 20px auto !important;
  }
}

/* --- Mobile portrait (≤ 580px) --- */
@media (max-width: 580px) {
  #navigation-hub {
    padding: 16px var(--container-padding);
  }

  .hub-wrapper {
    padding: 0;
    gap: 12px;
  }

  .hub-portrait {
    max-width: 280px;
  }

  .hub-portrait-body {
    height: 240px;
  }

  .hub-portrait-header {
    padding: 10px 14px;
  }

  .hub-portrait-header .dot {
    width: 10px;
    height: 10px;
  }

  .hub-portrait-header .title {
    font-size: 11px;
  }

  .hub-terminal-header {
    padding: 10px 14px;
  }

  .hub-terminal-header .dot {
    width: 10px;
    height: 10px;
  }

  .hub-terminal-header .title {
    font-size: 11px;
  }

  .hub-terminal-body {
    padding: 14px;
  }

  .hub-terminal-body .prompt {
    font-size: 12px;
    margin-bottom: 12px;
  }

  .hub-item {
    padding: 10px 14px;
    font-size: 15px;
  }

  .hub-item .num {
    margin-right: 10px;
    font-size: 14px;
  }

  .social-item {
    padding: 8px 12px;
    font-size: 13px;
    gap: 10px;
  }

  .social-icon {
    font-size: 18px;
  }

  /* Projects page adjustments */
  .projects-layout {
    padding: 12px 8px;
    gap: 8px;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .pc-mockup {
    width: 95%;
    max-width: 400px;
  }

  .app-window {
    border-radius: 10px;
    margin-top: -100px;
    flex: 1 1 auto;
    min-height: 0;
  }

  .app-window-header {
    padding: 8px 14px;
  }

  .app-title {
    font-size: 12px;
  }

  .window-dots .dot {
    width: 10px;
    height: 10px;
  }

  .app-window-body {
    padding: 14px;
    gap: 10px;
  }

  .category-tab {
    padding: 5px 10px;
    font-size: 12px;
  }

  .project-select-btn {
    height: 38px;
    font-size: 12px;
    padding: 0 10px;
    gap: 8px;
  }

  .project-counter {
    font-size: 11px;
  }

  .nav-arrow-btn {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .project-name {
    font-size: 16px;
  }

  .project-tag {
    font-size: 11px;
  }

  .project-desc-wrapper {
    font-size: 12px;
    line-height: 1.4;
  }

  .meta-section h4 {
    font-size: 11px;
  }

  .meta-section ul {
    font-size: 12px;
    padding-left: 14px;
  }

  .tech-tag {
    font-size: 11px;
    padding: 3px 8px;
  }

  .tech-tags-list {
    gap: 6px;
  }

  .app-footer {
    padding-top: 10px;
    gap: 8px;
  }

  .appstore-btn {
    font-size: 11px;
    padding: 6px 10px;
    gap: 6px;
  }

  .return-btn {
    font-size: 11px;
    gap: 6px;
  }
}

/* --- Smallest phones (≤ 450px) --- */
@media (max-width: 450px) {
  .hub-portrait {
    max-width: 100%;
  }

  .hub-portrait-body {
    height: 200px;
  }

  .hub-item {
    padding: 8px 12px;
    font-size: 14px;
  }

  .hub-item .num {
    margin-right: 8px;
    font-size: 13px;
  }

  .hub-item .arrow {
    display: none;
  }

  .social-item {
    padding: 8px 10px;
    font-size: 12px;
    gap: 8px;
  }

  .social-icon {
    font-size: 16px;
  }

  .projects-layout {
    padding: 8px 4px;
    gap: 6px;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
  }

  .pc-mockup {
    width: 90%;
    max-width: 340px;
  }

  /* App Window inside smallest screens */
  .projects-layout .app-window {
    margin-top: -90px;
    flex: 1 1 auto;
    min-height: 0;
  }

  .app-window-body {
    padding: 12px;
    gap: 8px;
  }

  .selector-nav-wrapper {
    gap: 6px;
  }

  .nav-arrow-btn {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .project-select-btn {
    height: 34px;
    font-size: 11px;
    padding: 0 8px;
  }

  .project-name {
    font-size: 15px;
  }

  .project-desc-wrapper {
    font-size: 11px;
  }

  .meta-section h4 {
    font-size: 10px;
  }

  .meta-section ul {
    font-size: 11px;
  }

  .tech-tag {
    font-size: 10px;
    padding: 2px 6px;
  }

  .app-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .appstore-btn {
    justify-content: center;
    width: 100%;
    text-align: center;
  }

  .return-btn {
    justify-content: center;
    margin-left: 0;
  }
}