/* === GLOBAL VARIABLES === */
:root {
  --border-width: 1px; /* Change this value to adjust all borders (e.g., 2px, 3px, 0.5px) */
  --border-color: #288dff;

  --grid-color-rgb: 40, 141, 255; /* The RGB values for #288DFF */
  --grid-opacity: 0.1; /* Adjust for perceived thickness (0.1 to 1) */
  --grid-thickness: 1px; /* Best to keep at 1px for sharpness */
  --grid-scale: 30px;
  --grid-rotation: 0deg;
}

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

/* General Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Hide mobile layout on desktop */
.name-container,
.menu-top,
.main-content-body,
.menu-bottom {
  display: none;
}

body {
  font-family: "Space Mono", monospace;
  font-size: 16px;
  background-color: white;
  padding: 10px 10px 0 10px; /* top, right, bottom, left - removed bottom padding only */
  overflow: hidden; /* Prevent body from scrolling */
}

.container {
  width: 100%;
  height: calc(100vh - 10px); /* Account for top padding only */
  background-color: white;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: grid;
  grid-template-columns: 0.8fr 0.64fr 0.64fr 0.64fr 0.64fr 0.64fr;
  height: 80px;
  min-height: 80px;
  border: var(--border-width) solid var(--border-color);
}

/* Name Section */
.name-section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background-color: white;
  border-right: var(--border-width) solid var(--border-color);
  cursor: pointer;
}

.name-section h1 {
  font-family: "Barriecito-Regular", sans-serif;
  font-size: 76px;
  font-weight: 400;
  color: #288dff;
  line-height: 0.8;
  text-align: center;
  margin: 0;
  padding: 0;
  vertical-align: middle;
}

/* CTA Button - Base styles */
.cta-button {
  background-color: var(--border-color);
  color: white;
  border: none;
  padding: 15px 30px;
  font-family: "Space Mono", monospace;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  transform: translateZ(0); /* Force hardware acceleration */
  backface-visibility: hidden; /* Prevent rendering artifacts */
}

.cta-button:hover {
  background-color: #3d7bc6;
}

/* Paper Link Button - Base styles (same as CTA but visible on mobile) */
.paper-link-button {
  background-color: var(--border-color);
  color: white;
  border: none;
  padding: 15px 30px;
  font-family: "Space Mono", monospace;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
  transform: translateZ(0); /* Force hardware acceleration */
  backface-visibility: hidden; /* Prevent rendering artifacts */
}

.paper-link-button:hover {
  background-color: #3d7bc6;
}

/* === RESPONSIVE DESIGN === */

/* Extra Large Screens (1600px - 1880px) */
@media (min-width: 1600px) and (max-width: 1880px) {
  .name-section h1 {
    font-size: 64px;
  }
}

/* Large Laptops and smaller desktops (1400px - 1599px) */
@media (max-width: 1599px) {
  body {
    padding: 8px 8px 0 8px;
  }
  .container {
    height: calc(100vh - 8px);
  }
  .name-section h1 {
    font-size: 54px;
  }
}

/* Medium Laptops (1200px - 1399px) */
@media (max-width: 1399px) {
  .name-section h1 {
    font-size: 48px;
  }
  body {
    padding: 6px 6px 0 6px;
  }
  .container {
    height: calc(100vh - 6px);
  }
  .container .header {
    height: 70px !important;
    min-height: 70px !important;
  }
  .container .titles-section,
  .container.resume-view .titles-section,
  .container.home-view .titles-section {
    height: 45px !important;
    min-height: 45px !important;
  }
  .profile-image-container {
    height: 250px;
    min-height: 250px;
  }
  .description {
    height: 150px;
    min-height: 150px;
  }
}

/* Small Laptops - 13 inch screens (1024px - 1199px) */
@media (max-width: 1199px) {
  .name-section h1 {
    font-size: 40px;
  }
  body {
    padding: 5px 5px 0 5px;
    font-size: 14px;
  }
  .container {
    height: calc(100vh - 5px);
  }
  .container .header {
    height: 60px !important;
    min-height: 60px !important;
  }
  .container .titles-section,
  .container.resume-view .titles-section,
  .container.home-view .titles-section {
    height: 35px !important;
    min-height: 35px !important;
  }
  .title-item {
    padding: 0 12px;
  }
  .profile-image-container {
    height: 200px;
    min-height: 200px;
    padding: 8px;
  }
  .description {
    height: 120px;
    min-height: 120px;
    padding: 15px;
  }
  .details {
    padding: 15px;
  }
  .project-item {
    padding: 15px;
  }
  .footer {
    height: 35px;
    min-height: 35px;
  }
}

/* Very Small Laptops and Large Tablets (768px - 1023px) */
@media (max-width: 1023px) {
  .name-section h1 {
    font-size: 30px;
  }
  body {
    padding: 3px 3px 0 3px;
    font-size: 13px;
  }
  .container {
    height: calc(100vh - 3px);
  }
  .container .header {
    height: 50px !important;
    min-height: 50px !important;
  }
  .container .titles-section,
  .container.resume-view .titles-section,
  .container.home-view .titles-section {
    height: 30px !important;
    min-height: 30px !important;
  }
  .title-item {
    padding: 0 8px;
  }
  .profile-image-container {
    height: 150px;
    min-height: 150px;
    padding: 5px;
  }
  .description {
    height: 100px;
    min-height: 100px;
    padding: 10px;
  }
  .details {
    padding: 10px;
  }
  .project-item {
    padding: 10px;
  }
  .footer {
    height: 30px;
    min-height: 30px;
  }
  .footer p {
    font-size: 9px;
  }
}

/* Tablets (481px - 767px) */
@media (max-width: 767px) {
  .name-section h1 {
    font-size: 28px;
  }
  body {
    padding: 2px 2px 0 2px;
    font-size: 12px;
  }
  .container {
    height: calc(100vh - 2px);
  }
  /* Stack layout vertically for mobile */
  .main-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
  }
  .column:not(:first-child) {
    margin-left: 0;
    margin-top: calc(-1 * var(--border-width));
  }
  .titles-section {
    grid-template-columns: 1fr;
    height: auto;
    min-height: auto;
  }
  .title-item {
    padding: 10px;
    text-align: center;
  }

  /* Small tablet list styling for project detail content */
  .project-detail-content ul:not(.content-index-box *) {
    margin: 12px 0 !important;
    padding-left: 0 !important;
    list-style: none !important;
  }

  .project-detail-content ul:not(.content-index-box *) li {
    margin-bottom: 6px !important;
    padding-left: 15px !important;
    position: relative !important;
    line-height: 1.4 !important;
  }

  .project-detail-content ul:not(.content-index-box *) li:before {
    content: "•" !important;
    color: var(--border-color) !important;
    font-weight: bold !important;
    position: absolute !important;
    left: 0 !important;
  }
}

/* === RESPONSIVE HOME PAGE CONTENT === */

/* Large Laptops and smaller desktops (1400px - 1599px) */
@media (max-width: 1599px) {
  .home-boxes-container {
    gap: 18px;
  }
  .home-box {
    padding: 18px;
    min-height: 320px;
    max-width: 380px;
  }
  .cta-button {
    padding: 14px 28px;
    font-size: 1.05rem;
  }
  .paper-link-button {
    padding: 14px 28px;
    font-size: 1.05rem;
  }
}

/* Medium Laptops (1200px - 1399px) */
@media (max-width: 1399px) {
  .home-boxes-container {
    gap: 16px;
  }
  .home-box {
    padding: 16px;
    min-height: 300px;
    max-width: 360px;
  }
  .stat-circle {
    width: 55px;
    height: 55px;
    font-size: 1.1em;
  }
  .stat-label {
    font-size: 0.95em;
  }
  .cta-button {
    padding: 13px 26px;
    font-size: 1rem;
  }
  .paper-link-button {
    padding: 13px 26px;
    font-size: 1rem;
  }
  .home-box model-viewer {
    transform: scale(0.98);
  }
}

/* Small Laptops - 13 inch screens */
@media (max-width: 1199px) {
  .home-boxes-container {
    gap: 14px;
  }
  .home-box {
    padding: 14px;
    min-height: 270px;
    max-width: 340px;
  }
  .stat-circle {
    width: 50px;
    height: 50px;
    font-size: 1em;
  }
  .stat-label {
    font-size: 0.9em;
  }
  .cta-button {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
  .paper-link-button {
    padding: 12px 24px;
    font-size: 0.95rem;
  }
  .home-box model-viewer {
    transform: scale(0.95);
  }
}

/* Very Small Laptops and Large Tablets */
@media (max-width: 1023px) {
  .home-boxes-container {
    flex-direction: column;
    gap: 12px;
  }
  .home-box {
    max-width: none;
    min-height: 220px;
    padding: 12px;
  }
  .stat-circle {
    width: 45px;
    height: 45px;
    font-size: 0.9em;
  }
  .stat-label {
    font-size: 0.85em;
  }
  .cta-button {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  .paper-link-button {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  .home-box model-viewer {
    transform: scale(0.9);
  }

  /* Tablet list styling for project detail content */
  .project-detail-content ul:not(.content-index-box *) {
    margin: 14px 0 !important;
    padding-left: 0 !important;
    list-style: none !important;
  }

  .project-detail-content ul:not(.content-index-box *) li {
    margin-bottom: 7px !important;
    padding-left: 18px !important;
    position: relative !important;
    line-height: 1.45 !important;
  }

  .project-detail-content ul:not(.content-index-box *) li:before {
    content: "•" !important;
    color: var(--border-color) !important;
    font-weight: bold !important;
    position: absolute !important;
    left: 0 !important;
  }
}

/* Tablets and Mobile */
@media (max-width: 767px) {
  .home-content-container {
    gap: 6px;
    padding: 0 15px; /* Only horizontal padding for tablets */
  }
  .home-boxes-container {
    gap: 8px;
  }
  .home-box {
    min-height: 160px;
    padding: 10px;
  }
  .stat-item {
    gap: 8px;
  }
  .stat-circle {
    width: 35px;
    height: 35px;
    font-size: 0.75em;
  }
  .stat-label {
    font-size: 0.7em;
  }
  .cta-button {
    padding: 6px 12px;
    font-size: 0.7rem;
  }
  .home-box model-viewer {
    transform: scale(0.8);
  }

  /* Mobile list styling for project detail content */
  .project-detail-content ul:not(.content-index-box *) {
    margin: 12px 0 !important;
    padding-left: 0 !important;
    list-style: none !important;
  }

  .project-detail-content ul:not(.content-index-box *) li {
    margin-bottom: 6px !important;
    padding-left: 15px !important;
    position: relative !important;
    line-height: 1.4 !important;
  }

  .project-detail-content ul:not(.content-index-box *) li:before {
    content: "•" !important;
    color: var(--border-color) !important;
    font-weight: bold !important;
    position: absolute !important;
    left: 0 !important;
  }
}

/* Navigation Items */
.nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background-color: white;
  border-right: var(--border-width) solid var(--border-color);
}

.nav-item:last-child {
  border-right: none;
}

/* Interactive States */
[data-category],
[data-project] {
  cursor: pointer;
  transition: background-color 0.3s ease;
}

[data-category]:hover,
[data-project]:hover {
  background-color: #eaf4ff;
}

[data-category].active,
[data-project].active {
  background-color: #288dff;
  color: white;
}

[data-category].active:hover,
[data-project].active:hover {
  background-color: #3d7bc6;
}

/* Titles Section */
.titles-section {
  display: grid;
  grid-template-columns: 0.8fr 2.56fr 0.64fr;
  height: 50px; /* Fixed height for titles */
  min-height: 50px; /* Prevent compression */
  align-items: center;
}

.container.home-view .title-item {
  opacity: 0;
  transition-delay: 0s;
}

.title-item {
  padding: 0 20px;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transition-delay 0.4s;
}

/* Main Body */
.main-body {
  display: grid;
  grid-template-columns: 0.8fr 2.56fr 0.64fr;
  flex: 1; /* Fill remaining space */
  min-height: 0; /* Allow flex container to shrink */
  transition: grid-template-columns 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.column {
  border: var(--border-width) solid var(--border-color);
  background-color: white;
  display: flex;
  flex-direction: column;
  overflow-y: auto; /* Restore default scrolling */
  scrollbar-width: none; /* For Firefox */
  scroll-behavior: smooth; /* Enable smooth scrolling in all columns */
  transition: opacity 0.3s ease 0.2s,
    border-width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.center-column {
  position: relative;
  z-index: 1;
  background-color: transparent;
  overflow: hidden; /* To contain the rotated pseudo-element */
}

.center-column::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: white;
  background-image: repeating-linear-gradient(
      0deg,
      rgba(var(--grid-color-rgb), var(--grid-opacity)),
      rgba(var(--grid-color-rgb), var(--grid-opacity)) var(--grid-thickness),
      transparent var(--grid-thickness),
      transparent var(--grid-scale)
    ),
    repeating-linear-gradient(
      90deg,
      rgba(var(--grid-color-rgb), var(--grid-opacity)),
      rgba(var(--grid-color-rgb), var(--grid-opacity)) var(--grid-thickness),
      transparent var(--grid-thickness),
      transparent var(--grid-scale)
    );
  background-size: var(--grid-scale) var(--grid-scale);
  transform: rotate(var(--grid-rotation));
  will-change: transform; /* Optimize for transforms */
  backface-visibility: hidden; /* Prevent rendering artifacts */
}

.column:not(:first-child) {
  margin-left: calc(-1 * var(--border-width));
}

.hero-image-container {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 1; /* Below content but above background */
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding-bottom: var(--spacing-large);
  box-sizing: border-box;
  pointer-events: none; /* Allow scroll events to pass through */
}

.center-column .hero-image-container {
  width: 100%;
  margin-left: 0;
  left:0;
  right: 0;
  max-width: none;
  padding: 0;
}


.scroll-indicator {
  color: white;
  text-align: center;
  animation: bounce 2s infinite;
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.5);
  pointer-events: auto; /* Re-enable pointer events for scroll indicator */
  cursor: pointer;
}

.scroll-indicator svg {
  width: 24px;
  height: 24px;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translate(-50%, 0);
  }
  40% {
    transform: translate(-50%, -20px);
  }
  60% {
    transform: translate(-50%, -10px);
  }
}

.project-detail-content {
  position: relative;
  z-index: 10;
  background: var(--color-background-light);
  padding-top: var(--spacing-large); /* Add padding to push content down */
}

/* Simple hero image overlay - doesn't affect existing content structure */
.center-column:has(.hero-image-container) {
  background-color: var(--color-background-light);
  overflow-y: auto;
}

.center-column:has(.hero-image-container)::before {
  display: none; /* Hide the grid background when hero image is present */
}




/* === Homepage View === */
.home-view .titles-section {
  grid-template-columns: 0.8fr 2.56fr 0.64fr;
  height: 50px; /* Fixed height for titles */
  min-height: 50px; /* Prevent compression */
  align-items: center;
}

.container.home-view .main-body {
  grid-template-columns: 0fr 1fr 0fr;
}

.container.home-view .center-column {
  justify-content: center;
  overflow-y: auto; /* Enable scrolling for home page if content overflows */
  scrollbar-width: none; /* Hide scrollbar for Firefox */
  will-change: scroll-position; /* Optimize for scrolling */
  backface-visibility: hidden; /* Prevent rendering artifacts */
  transform: translateZ(0); /* Force hardware acceleration */
  -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.container.home-view .center-column::-webkit-scrollbar {
  display: none; /* Hide scrollbar for WebKit browsers */
}

.container.home-view .project-detail-content {
  padding: 0; /* Remove padding on home screen */
}

.container.home-view .left-column,
.container.home-view .right-column,
.container.resume-view .right-column {
  opacity: 0;
  border-width: 0;
  overflow: hidden; /* Hide overflow only on shrinking columns */
}

.home-greeting {
  font-size: 1.5em;
  font-weight: bold;
  text-align: center;
  width: 100%;
  margin-bottom: 1rem;
}

/* Hide scrollbar for WebKit browsers */
.column::-webkit-scrollbar,
.description::-webkit-scrollbar {
  display: none;
}

model-viewer {
  width: 100%;
  height: 100%; /* Fill the container */
  background-color: transparent;
  touch-action: pan-x pan-y; /* Enable proper touch handling */
}

.profile-image-container {
  padding: 10px;
  border-bottom: var(--border-width) solid var(--border-color);
  height: 300px; /* Fixed height for image container */
  min-height: 300px; /* Prevent compression */
  position: relative; /* Ensure proper positioning context */
  overflow: visible; /* Allow model-viewer to handle its own overflow */
}

.profile-image-container img {
  width: 100%;
  display: block;
  border: var(--border-width) solid var(--border-color);
}

.description {
  padding: 20px;
  border-bottom: var(--border-width) solid var(--border-color);
  font-style: italic;
  height: 175px;
  min-height: 175px;
  overflow-y: auto;
  scrollbar-width: none;
  display: flex;
  align-items: center;
  text-align: left;
}

.details {
  padding: 20px;
  flex: 1; /* Fill remaining space - adaptive height */
  min-height: 0; /* Allow flex item to shrink below content size */
}

.details p {
  margin-bottom: 8px;
}

/* Style for detail labels */
.details p strong,
.details p b {
  background-color: #eaf4ff;
  color: black;
  padding: 2px 0;
  font-weight: bold;
  display: inline;
}

/* === PROJECT DETAIL CONTENT LIST STYLING === */
.project-detail-content ul:not(.content-index-box *) {
  margin: 15px 0 !important;
  padding-left: 0 !important;
  list-style: none !important;
}

.project-detail-content ul:not(.content-index-box *) li {
  margin-bottom: 8px !important;
  padding-left: 20px !important;
  position: relative !important;
  line-height: 1.5 !important;
}

.project-detail-content ul:not(.content-index-box *) li:before {
  content: "•" !important;
  color: var(--border-color) !important;
  font-weight: bold !important;
  position: absolute !important;
  left: 0 !important;
}

/* === RESUME MARKDOWN STYLING === */
.container.resume-view .project-detail-content h1 {
  font-size: 2.2em;
  color: var(--border-color);
  text-align: center;
  margin-bottom: 8px;
  margin-top: 16px;
  font-family: "Barriecito-Regular", sans-serif;
}

.container.resume-view .project-detail-content h1 + p {
  text-align: center;
  font-weight: bold;
  color: #666;
  margin-bottom: 30px;
  font-size: 1.1em;
}

.container.resume-view .project-detail-content h2 {
  font-size: 1.4em;
  color: var(--border-color);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 5px;
  margin-top: 35px;
  margin-bottom: 20px;
  font-family: "Barriecito-Regular", sans-serif;
}

.container.resume-view .project-detail-content h3 {
  font-size: 1.2em;
  color: #333;
  margin-top: 25px;
  margin-bottom: 8px;
  font-weight: bold;
}

.container.resume-view .project-detail-content h3 + p {
  margin-top: 5px;
  font-style: italic;
  color: #555;
}

.container.resume-view .project-detail-content hr {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 30px 0;
}

.container.resume-view .project-detail-content ul {
  margin: 15px 0;
  padding-left: 0;
  list-style: none;
}

.container.resume-view .project-detail-content ul li {
  margin-bottom: 8px;
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}

.container.resume-view .project-detail-content ul li:before {
  content: "•";
  color: var(--border-color);
  font-weight: bold;
  position: absolute;
  left: 0;
}

.container.resume-view .project-detail-content strong {
  color: var(--border-color);
  font-weight: bold;
}

.container.resume-view .project-detail-content em {
  color: #666;
  font-style: italic;
}

/* Resume section spacing */
.container.resume-view .project-detail-content > h2:first-child {
  margin-top: 0;
}

/* Responsive adjustments for resume */
@media (max-width: 767px) {
  .container.resume-view .project-detail-content h1 {
    font-size: 1.8em;
  }

  .container.resume-view .project-detail-content h2 {
    font-size: 1.2em;
  }

  .container.resume-view .project-detail-content h3 {
    font-size: 1.1em;
  }
}

.details-link {
  color: inherit;
  text-decoration: none;
}

.details-link:hover {
  text-decoration: underline;
  color: var(--border-color);
}

.project-detail-content {
  padding: 20px;
  height: 100%;
  border-bottom: 3px solid #288dff;
  overflow-y: auto;
  scrollbar-width: none; /* For Firefox */
}

.project-detail-content::-webkit-scrollbar {
  display: none;
}

.text-content-wrapper {
  max-width: 800px;
  margin-left: 0;
  margin-right: auto;
  text-align: left;
}

.text-content-wrapper figure:not(.full-width) {
  max-width: 800px;
}

.project-detail-content figure {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.project-detail-content figure.full-width {
  width: 100%;
}

.project-detail-content figure.full-width img {
  width: 100%;
  max-width: none;
  object-fit: cover;
}

.project-detail-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border: var(--border-width) solid var(--border-color);
}

.project-detail-content figcaption {
  margin-top: 8px;
  font-size: 0.9em;
  font-style: italic;
  color: #555;
  text-align: center;
}

/* --- Detail Section Text Spacing Controls --- */
/* Adjust these values to control spacing in detail content */

/* Paragraph spacing in detail section */
.project-detail-content p {
  margin-top: 16px; /* Space before each paragraph */
  margin-bottom: 16px; /* Space after each paragraph */
}

/* First paragraph - no top margin */
.project-detail-content p:first-child {
  margin-top: 0;
}

/* Last paragraph - no bottom margin */
.project-detail-content p:last-child {
  margin-bottom: 0;
}

/* Heading spacing in detail section */
.project-detail-content h2,
.project-detail-content h3,
.project-detail-content h4 {
  margin-top: 24px; /* Space before each heading */
  margin-bottom: 12px; /* Space after each heading */
}

/* First heading - no top margin */
.project-detail-content h2:first-child {
  margin-top: 24px;
}

.project-detail-content h3:first-child,
.project-detail-content h4:first-child {
  margin-top: 0;
}

.project-detail-content figure {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.project-detail-content figure.full-width {
  width: 100%;
}

.project-detail-content .text-content-wrapper figure {
  max-width: 100%;
}

.project-detail-content img {
  max-width: 100%;
  height: auto;
  display: block;
  border: var(--border-width) solid var(--border-color);
}

.project-detail-content figcaption {
  margin-top: 8px;
  font-size: 0.9em;
  font-style: italic;
  color: #555;
  text-align: center;
}

/* --- Content Index Box --- */
.content-index-box {
  background-color: #eaf4ff;
  padding: 20px 0;
  margin: -20px -20px 0px -20px;
}

.content-index-box p {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--border-color);
  font-weight: normal;
  font-size: 20px;
  padding-left: 20px;
  font-family: "Barriecito-Regular", sans-serif;
}

.content-index-box ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

/* Style for indented items in the content index box */
.content-index-box li.indented {
  padding-left: 20px;
  position: relative;
}

.content-index-box li.indented::before {
  content: "•";
  color: var(--border-color);
  position: absolute;
  left: 40px;
}

.content-index-box li.indented a {
  padding-left: 35px;
}

/* Override resume-view styles for content-index-box */
.container.resume-view .content-index-box ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.container.resume-view .content-index-box ul li {
  margin-bottom: 0;
  padding-left: 0;
  position: static;
  line-height: auto;
}

.container.resume-view .content-index-box ul li:before {
  display: none;
}

.content-index-box ul li a {
  display: block;
  padding: 0 0 0 40px;
  color: #288dff;
  text-decoration: underline;
  transition: color 0.2s;
  font-size: 14px;
  line-height: auto;
}

.content-index-box ul li a:hover {
  color: #2d6bb5;
  text-decoration: underline;
}

.projects-grid {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* --- General Button Styles --- */
[data-category],
[data-project] {
  cursor: pointer;
  transition: background-color 0.3s ease;
}

[data-category]:hover,
[data-project]:hover {
  background-color: #eaf4ff;
}

[data-category].active,
[data-project].active {
  background-color: #288dff;
  color: white;
}

[data-category].active:hover,
[data-project].active:hover {
  background-color: #3d7bc6;
}

.project-item {
  padding: 20px;
  border-bottom: var(--border-width) solid var(--border-color);
  flex-grow: 1;
  display: flex;
  align-items: center;
  line-height: 1.4;
}

.project-item:last-child {
  border-bottom: none;
}

/* --- 404 Not Found Content --- */
.not-found-content {
  text-align: center;
  padding: 50px 20px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.not-found-content h1 {
  font-family: "Barriecito-Regular", sans-serif;
  font-size: 8rem;
  color: var(--border-color);
  line-height: 1;
  margin-bottom: 0;
}

.not-found-content p {
  font-size: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
}

.not-found-content a {
  text-decoration: none;
  color: white;
  background-color: var(--border-color);
  padding: 12px 24px;
  transition: background-color 0.3s;
  font-size: 1rem;
  cursor: pointer;
}

.not-found-content a:hover {
  background-color: #3d7bc6;
}

/* --- Resume View --- */
/* Hides right column and last title for resume */
.container.resume-view .main-body,
.container.resume-view .titles-section {
  grid-template-columns: 1fr 3fr 0fr;
}

.container.resume-view .titles-section .title-item:last-child {
  opacity: 0;
  transition-delay: 0s;
}

.container.resume-view .right-column {
  /* The hiding is now handled by the shared opacity/border rule above */
  display: block; /* Override any potential 'display: none' */
}

/* --- Home Page Specific Styles --- */
.home-content-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%; /* Use min-height to allow growth when content overflows */

  gap: 10px;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px; /* Only horizontal padding for edge spacing */
  box-sizing: border-box;
  transform: translateZ(0); /* Force hardware acceleration */
  backface-visibility: hidden; /* Prevent rendering artifacts */
}

.home-content-container p {
  margin: 0;
}

.home-text {
  text-align: center;
  width: 100%;
  line-height: 1.6;
}

.home-boxes-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch; /* Make boxes same height */
  gap: 20px;
  width: 100%;
  margin: 0;
}

.home-box {
  padding: 20px;
  flex: 1; /* Make them share space */
  max-width: 400px; /* Limit max width */
  min-height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.home-box.stats-box {
  align-items: flex-start; /* Align text to left */
  justify-content: center;
  gap: 20px;
}

.home-box model-viewer {
  width: 100%;
  height: 100%;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 15px; /* Space between circle and text */
  opacity: 0; /* Initially hidden for entrance animation */
}

.stat-item.visible {
  animation: fadeInUp 0.5s ease-out forwards;
  /* Delay is set dynamically via JS */
  animation-delay: var(--animation-delay, 0s);
}

.stat-circle {
  background-color: transparent;
  color: var(--border-color);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.2em;
  flex-shrink: 0; /* Prevent circle from shrinking */
  border: 2px dashed var(--border-color);
  font-family: "Barriecito-Regular", sans-serif;
}

.stat-label {
  color: var(--border-color);
  font-size: 1em;
  font-weight: bold;
  font-family: "Barriecito-Regular", sans-serif;
}

/* --- Animations --- */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.stat-circle.spinning {
  animation-name: spin;
  animation-timing-function: linear;
  /* Duration will be set dynamically via JS */
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Footer */
.footer {
  height: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: white;
}

.footer-link {
  cursor: pointer;
  font-weight: bold;
  color: var(--border-color);
}

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

.footer p {
  font-size: 10px;
}

/* --- Contact Page Specific Styles --- */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

.form-group input,
.form-group textarea {
  padding: 12px;
  border: var(--border-width) solid var(--border-color);
  background-color: #f8f9fa;
  font-family: "Space Mono", monospace;
  font-size: 1rem;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #3d7bc6;
  box-shadow: 0 0 0 3px rgba(40, 141, 255, 0.2);
}

.submit-button {
  padding: 15px;
  background-color: var(--border-color);
  color: white;
  border: none;
  font-family: "Space Mono", monospace;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.submit-button:hover {
  background-color: #3d7bc6;
}

.submit-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.submit-button:disabled:hover {
  background-color: #ccc;
}

.form-status {
  margin-top: 15px;
}

.success-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  font-family: "Space Mono", monospace;
  font-size: 0.9rem;
}

.error-message {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  font-family: "Space Mono", monospace;
  font-size: 0.9rem;
}

.success-icon,
.error-icon {
  flex-shrink: 0;
}

.button-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.button-loading::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.social-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-bottom: var(--border-width) solid #eee;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.2s ease;
}

.social-item:hover {
  background-color: #f8f9fa;
}

.social-item:hover .social-icon {
  fill: var(--border-color);
}

.social-icon {
  width: 32px;
  height: 32px;
  fill: #333;
  transition: fill 0.2s ease;
}

.social-platform {
  font-weight: bold;
}

.social-handle {
  color: #555;
  font-size: 0.9em;
}

/* === Detail Component === */
.detail-component {
  width: 90%;
  margin: 0 auto 20px auto;
  border: 1px solid #c7ddf5;
  border-radius: 0px;
  overflow: hidden;
  background-color: white;
}

.detail-header {
  background-color: #eaf4ff;
  min-height: 40px;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #c7ddf5;
}

.detail-header.closable {
  cursor: pointer;
}

.toggle-icon {
  font-size: 24px;
  font-weight: bold;
  color: #288dff;
}

.detail-header h4 {
  margin: 0;
  font-weight: 500;
  font-size: 1rem;
  color: #333;
  line-height: 1.3;
  word-wrap: break-word;
}

.detail-content {
  padding: 20px;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
  max-height: 1000px; /* Arbitrary large value */
}

.detail-content.collapsed {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-top: none;
}

.detail-image-wrapper {
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  max-height: 1000px; /* Arbitrary large value */
}

.detail-image-wrapper.collapsed {
  max-height: 0;
  border-top: none;
}

.detail-image-wrapper img {
  width: 100%;
  height: auto;
  display: block;
  border: none;
}

.detail-table-wrapper {
  overflow: hidden;
  transition: max-height 0.3s ease-out;
  max-height: 1000px; /* Arbitrary large value */
  padding: 0;
}

.detail-table-wrapper.collapsed {
  max-height: 0;
  border-top: none;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.detail-table th,
.detail-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.detail-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #c7ddf5;
}

.detail-table tbody tr:last-child td {
  border-bottom: none;
}

/* === Workflow Component === */
.workflow-component {
  width: 90%;
  margin: 0 auto 20px auto;
}

.workflow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
}

.workflow-step {
  background-color: #f9fcff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  text-align: center;
  min-height: 140px;
  border: 1px solid #c7ddf5;
  border-radius: 4px;
}



.workflow-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80px;
  gap: 8px;
}

.workflow-bottom {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8px;
}

.workflow-icon {
  font-size: 2rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.workflow-icon svg {
  width: 100%;
  height: 100%;
  color: #288dff;
  stroke: #288dff;
  stroke-width: 2.5;
}

.workflow-label {
  font-weight: 600;
  color: #288dff;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.workflow-text {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.4;
  max-width: 280px;
}

/* === Flow Component === */
.flow-component {
  width: 90%;
  margin: 0 auto 20px auto;
}

.flow-container {
  display: flex;
  align-items: stretch; /* Ensures all items have equal height */
  gap: 0; /* No gap since we want tight spacing */
  min-height: 160px; /* Ensures minimum height */
}

.flow-step {
  flex: 3; /* Wide boxes get 3 units */
  background-color: #f9fcff;
  border: 1px solid #c7ddf5;
  border-radius: 4px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 15px;
}

.flow-step-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  max-width: 200px;
}

.flow-icon {
  font-size: 2rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.flow-icon svg {
  width: 100%;
  height: 100%;
  color: #288dff;
  stroke: #288dff;
  stroke-width: 2.5;
}

.flow-header {
  font-weight: 600;
  color: #288dff;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.flow-text {
  font-size: 0.9rem;
  color: #555;
  line-height: 1.4;
}

.flow-arrow {
  flex: 1; /* Narrow boxes get 1 unit */
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  padding: 10px 5px;
}

.flow-arrow svg {
  width: 24px;
  height: 24px;
  color: #288dff;
  stroke: #288dff;
}

/* === Flow Component Responsive === */
@media (max-width: 768px) {
  .flow-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .flow-step {
    flex: none;
    min-height: 120px;
  }

  .flow-step-content {
    max-width: 100%;
    gap: 8px;
  }

  .flow-icon {
    font-size: 1.4rem;
    width: 1.4rem;
    height: 1.4rem;
  }

  .flow-header {
    font-size: 0.8rem;
    letter-spacing: 0.3px;
  }

  .flow-text {
    font-size: 0.82rem;
    line-height: 1.3;
  }

  .flow-arrow {
    flex: none;
    padding: 8px;
    transform: rotate(90deg);
  }

  .flow-arrow svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 480px) {
  .flow-component {
    width: 95%;
  }

  .flow-step {
    padding: 12px 8px;
    min-height: 100px;
  }

  .flow-step-content {
    gap: 6px;
  }

  .flow-header {
    font-size: 0.75rem;
  }

  .flow-text {
    font-size: 0.78rem;
  }
}

/* === Image Carousel Component === */
.image-carousel-figure {
  width: 100%;
  max-width: 800px;
  margin: 20px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.image-carousel {
  width: 100%;
  position: relative;
}

.carousel-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.carousel-slides {
  width: 100%;
  position: relative;
  overflow: hidden;
}

.carousel-slide {
  display: none;
  width: 100%;
  position: relative;
}

.carousel-slide.active {
  display: block;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

.carousel-figcaption {
  margin-top: 8px;
  font-size: 0.9em;
  font-style: italic;
  color: #555;
  text-align: center;
}

.carousel-caption-text {
  line-height: 1.4;
  margin: 0;
  min-height: 1.4em; /* Prevent layout shift when caption changes */
}

.carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #c7ddf5;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
  z-index: 2;
}

.carousel-nav:hover:not(:disabled) {
  background-color: #288dff;
  transform: translateY(-50%) scale(1.05);
}

.carousel-nav:hover:not(:disabled) svg {
  stroke: white;
}

.carousel-nav:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  background-color: rgba(255, 255, 255, 0.5);
}

.carousel-nav svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5;
  stroke: #288dff;
}

.carousel-prev {
  left: 10px;
}

.carousel-next {
  right: 10px;
}

.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(199, 221, 245, 0.5);
  padding: 8px 12px;
  border-radius: 20px;
  backdrop-filter: blur(4px);
  z-index: 3;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: none;
  background-color: #c7ddf5;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.carousel-dot:hover {
  background-color: #288dff;
  transform: scale(1.2);
}

.carousel-dot.active {
  background-color: #288dff;
}

/* === Carousel Component Responsive === */
@media (max-width: 768px) {
  .carousel-slide img {
    max-height: 300px;
  }
  
  .carousel-figcaption {
    font-size: 0.8em;
  }
  
  .carousel-nav {
    width: 33px;
    height: 33px;
  }
  
  .carousel-nav svg {
    width: 16px;
    height: 16px;
    stroke: #288dff;
  }
  
  .carousel-prev {
    left: 8px;
  }
  
  .carousel-next {
    right: 8px;
  }
  
  .carousel-indicators {
    bottom: 15px;
    padding: 6px 10px;
  }
  
  .carousel-dot {
    width: 8px;
    height: 8px;
  }
}

@media (max-width: 480px) {
  .carousel-slide img {
    max-height: 250px;
  }
  
  .carousel-figcaption {
    font-size: 0.75em;
  }
  
  .carousel-nav {
    width: 29px;
    height: 29px;
  }
  
  .carousel-nav svg {
    width: 14px;
    height: 14px;
    stroke: #288dff;
  }
  
  .carousel-indicators {
    bottom: 12px;
    padding: 5px 8px;
    gap: 6px;
  }
  
  .carousel-dot {
    width: 6px;
    height: 6px;
  }
}

/* === LOADING SCREEN === */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: white;
  background-image: repeating-linear-gradient(
      0deg,
      rgba(var(--grid-color-rgb), var(--grid-opacity)),
      rgba(var(--grid-color-rgb), var(--grid-opacity)) var(--grid-thickness),
      transparent var(--grid-thickness),
      transparent var(--grid-scale)
    ),
    repeating-linear-gradient(
      90deg,
      rgba(var(--grid-color-rgb), var(--grid-opacity)),
      rgba(var(--grid-color-rgb), var(--grid-opacity)) var(--grid-thickness),
      transparent var(--grid-thickness),
      transparent var(--grid-scale)
    );
  background-size: var(--grid-scale) var(--grid-scale);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 1.5s ease-in-out;
}

.loading-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loading-content {
  text-align: center;
}

.loading-circle-container {
  position: relative;
  display: inline-block;
}

.loading-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 330px;
  height: 330px;
  margin-top: -165px;
  margin-left: -165px;
  border: 3px solid transparent;
  border-top: 3px solid #288dff;
  border-radius: 50%;
  animation: spin 2s linear infinite;
  z-index: 1;
}

.loading-content h1 {
  font-size: 3rem;
  color: #288dff;
  margin: 0;
  font-family: "Barriecito-Regular", sans-serif;
  font-weight: 400;
  line-height: 0.8;
  position: relative;
  z-index: 2;
}

@media (max-width: 1399px) {
  .loading-content h1 {
    font-size: 2.5rem;
  }
  .loading-circle {
    width: 285px;
    height: 285px;
    margin-top: -143px;
    margin-left: -143px;
  }
}

@media (max-width: 1199px) {
  .loading-content h1 {
    font-size: 2rem;
  }
  .loading-circle {
    width: 240px;
    height: 240px;
    margin-top: -120px;
    margin-left: -120px;
  }
}

@media (max-width: 1023px) {
  .loading-content h1 {
    font-size: 1.8rem;
  }
  .loading-circle {
    width: 210px;
    height: 210px;
    margin-top: -105px;
    margin-left: -105px;
  }
}

@media (max-width: 767px) {
  .loading-content h1 {
    font-size: 1.5rem;
  }
  .loading-circle {
    width: 180px;
    height: 180px;
    margin-top: -90px;
    margin-left: -90px;
    border: 2px solid transparent;
    border-top: 2px solid #288dff;
  }
}

@media (max-width: 480px) {
  .loading-content h1 {
    font-size: 1.2rem;
  }
  .loading-circle {
    width: 150px;
    height: 150px;
    margin-top: -75px;
    margin-left: -75px;
    border: 2px solid transparent;
    border-top: 2px solid #288dff;
  }
}

/* === VIDEO PLAYER STYLES === */
video {
  border: var(--border-width) solid var(--border-color);
  background-color: #000;
  width: 100%;
  max-width: 800px;
  aspect-ratio: 16/9; /* Fixed aspect ratio */
  object-fit: cover; /* Ensures both poster and video fit properly */
}

/* Video poster/thumbnail styling */
video::-webkit-media-controls-start-playback-button {
  background-color: rgba(40, 141, 255, 0.8);
  border-radius: 50%;
  color: white;
}

/* Style the video controls overlay */
video::-webkit-media-controls-panel {
  background-color: rgba(40, 141, 255, 0.1) !important;
  background-image: none !important;
}

video::-webkit-media-controls-timeline {
  border-radius: 2px;
}

video::-webkit-media-controls-timeline::-webkit-slider-thumb {
  border-radius: 50%;
}

/* Firefox video controls */
video::-moz-media-controls {
  background-color: rgba(40, 141, 255, 0.1) !important;
}

/* Ensure video figures maintain proper spacing */
figure video {
  margin-bottom: 0;
}
