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

:root {
  --background: #ffffff;
  --foreground: #475569;
  --accent: #006caa;
  --accent-rgb: 23, 119, 203;
  --font-sans: "Helvetica", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg-main: #F4F9FA;
  --bg-tile: #E9F2F6;
}

body {
  font-family: var(--font-sans);
  /* Background removed to show animated background */
  background-color: transparent;
  color: var(--foreground);
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* iOS Fade */
.ios-fade {
  display: none;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  right: 2rem;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0.5rem;
}

.bottom-nav-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.bottom-nav-left a {
  display: flex;
  align-items: center;
}

.bottom-nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-image {
  width: 104px;
  height: 52px;
  object-fit: contain;
  border-radius: 0.5rem;
  cursor: pointer;
}

.social-button {
  background-color: #000;
  padding: 0.75rem;
  border-radius: 0.25rem;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
  transition: all 0.2s;
  text-decoration: none;
  position: relative;
  overflow: hidden;
}

.social-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}

.social-button-linkedin::before {
  background-image: url('public/josh-icon-a.webp');
}

.social-button-artstation::before {
  background-image: url('public/josh-icon-b.webp');
}

.social-button:hover {
  color: rgba(223, 244, 252, 0.75);
}

.social-button svg {
  position: relative;
  z-index: 1;
}

/* Main Content */
.main-content {
  min-height: 100vh;
  position: relative;
  padding-bottom: 8rem;
  padding: 1rem 1rem 8rem;
  overflow: hidden;
  padding-top: 1.25rem;
}

/* Layout Container */
.layout-container {
  display: flex;
  flex-direction: column;
  padding: 1rem 1rem 8rem;
  /* max-width removed */
  margin: 0 auto;
  position: relative;
  /* Ensure content sits above background */
  z-index: 1;
}

@media (min-width: 768px) {
  .layout-container {
    padding: 2rem 2rem 8rem;
  }
}

@media (min-width: 1024px) {
  .layout-container {
    flex-direction: row;
    padding: 2rem 4rem 8rem;
    /* Reduced top padding from 4rem to 2rem */
    gap: 4rem;
    justify-content: space-between;
  }
}

/* Sidebar */
.sidebar {
  width: 100%;
}

@media (min-width: 1024px) {
  .sidebar {
    width: 33.333%;
    max-width: 28rem;
    position: sticky;
    top: 4rem;
    height: fit-content;
    flex-shrink: 0;
  }
}

/* Content Area */
.content-area {
  width: 100%;
}

@media (min-width: 1024px) {
  .content-area {
    width: 100%;
    max-width: 1600px;
    flex-grow: 1;
    padding-top: 60px;
  }
}

/* ... (skipping unchanged parts) ... */

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1400px) {
  .projects-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1800px) {
  .projects-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Intro Section */
.availability-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.availability-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background-color: var(--accent);
  color: #000;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
}

.availability-badge-desktop {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  color: #000;
  background-color: var(--accent);
}

.avatar-image {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--accent);
  border-radius: 50%;
  margin-right: 0.5rem;
}

.intro-text p {
  margin-bottom: 2rem;
  line-height: 1.6;
  color: #475569;
  font-weight: 500;
  font-size: 1.125rem;
  padding: 1rem 0;
}

.education-inline {
  font-size: 0.875rem;
  line-height: 1.6;
  color: #475569;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  padding-top: 1rem;
  margin-top: 1rem;
  margin-bottom: 3rem;
}

.made-with {
  font-size: 0.75rem;
  font-style: italic;
  color: #6b7280;
  margin-top: 0.5rem;
}

.verbose-link {
  display: block;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  font-weight: 700;
  font-style: normal;
  color: var(--accent);
  text-decoration: none;
}

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

.highlight-link {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  color: inherit;
  transition: text-decoration-color 0.2s;
}

.highlight-link:hover {
  text-decoration-color: rgb(22, 163, 74);
}

/* Section Titles */
.section-title {
  font-weight: 700;
  color: #475569;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  /*text-transform: uppercase;
  letter-spacing: 0.05em;*/
  margin-top: 5.625rem;
  padding-left: 1rem;
}

.content-area>section:first-child .section-title {
  margin-top: 0;
}

/* Projects */
.projects-section {
  margin-bottom: 0;
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .projects-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.project-card {
  background-color: var(--bg-main);
  border-radius: 1rem;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  position: relative;
  height: 20rem;
  min-height: 20rem;
  margin: 0;
  padding: 0;
  border: 0;
}

@media (min-width: 768px) {
  .project-card {
    height: 24rem;
    min-height: 24rem;
  }
}

.project-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.project-image-wrapper {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-color: var(--bg-main);
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover img {
  transform: scale(1.05);
}

.project-indicator {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background-color: var(--accent);
  transition: background-color 0.3s;
  z-index: 10;
}

.project-info {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(var(--accent-rgb), 0.85) 0%, rgba(var(--accent-rgb), 0.35) 50%, rgba(var(--accent-rgb), 0.15) 100%);
  transition: all 0.3s ease;
  z-index: 10;
  border-radius: 0;
}

.project-card:hover .project-info {
  background: linear-gradient(to top, rgba(var(--accent-rgb), 1) 0%, rgba(var(--accent-rgb), 0.5) 50%, rgba(var(--accent-rgb), 0.5) 100%);
}

.project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.project-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: #fff;
  line-height: 1.2;
}

.project-meta {
  font-size: 0.8rem;
  color: #fff;
}

.project-meta strong {
  font-weight: 500;
}

.project-icon {
  width: 1rem;
  height: 1rem;
  color: #fff;
  opacity: 0;
  transition: all 0.3s ease;
  flex-shrink: 0;
}

.project-card:hover .project-icon {
  opacity: 1;
}

/* Exploration Card Styles */
.exploration-card .project-info {
  background: rgba(240, 248, 250, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(13, 157, 209, 0.0);
  top: auto;
  /* Position at bottom */
  bottom: 0.25rem;
  left: 0.25rem;
  right: 0.25rem;
  border-radius: 0.8rem;
  padding: 1rem;
  z-index: 20;
  /* Ensure it sits above the gradient */
}

/* Gradient Overlay for Exploration Cards */
.exploration-card .project-image-wrapper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(var(--accent-rgb), 0.85) 0%, rgba(var(--accent-rgb), 0.35) 50%, rgba(var(--accent-rgb), 0.15) 100%);
  transition: all 0.3s ease;
  z-index: 10;
}

.exploration-card:hover .project-image-wrapper::after {
  background: linear-gradient(to top, rgba(var(--accent-rgb), 1) 0%, rgba(var(--accent-rgb), 0.5) 50%, rgba(var(--accent-rgb), 0.5) 100%);
}

.exploration-card:hover .project-info {
  background: rgba(223, 244, 252, 0.8);
  /* Slightly more opaque on hover */
}

.exploration-card .project-title {
  color: #475569;
  /* Dark text */
}

.exploration-card .project-meta {
  color: #475569;
  /* Dark text */
}

.exploration-card .project-icon {
  color: #475569;
  /* Dark icon */
}

/* Job Cards */
.job-card {
  position: relative;
  padding: 20px 20px 36px 20px;
  border-radius: 0.75rem;
  background-color: rgba(223, 244, 252, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(13, 157, 209, 0.1);
}

.job-title {
  margin-top: 2rem;
  font-weight: 700;
  color: #475569;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  line-height: 1.2;
}

.job-company {
  color: #475569;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

.job-duration {
  color: #475569;
  font-size: 0.875rem;
  display: block;
  margin-bottom: 0.75rem;
}

.job-responsibilities {
  position: relative;
  color: #58687e;
  list-style: disc;
  list-style-position: outside;
  padding-left: 1.25rem;
  padding-top: 1rem;
  font-size: 0.875rem;
  margin: 0;
}

.job-responsibilities::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0.75rem;
  height: 3px;
  background-color: var(--accent);
  border-radius: 999px;
}

.job-responsibilities li {
  margin-bottom: 0.5rem;
}

/* Education */
.education-section {
  margin-bottom: 0;
}

.education-card {
  position: relative;
  padding: 20px 20px 36px 20px;
  border-radius: 0.75rem;
  background-color: rgba(223, 244, 252, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(13, 157, 209, 0.1);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.education-card:last-child {
  margin-bottom: 0;
}

.education-degree {
  font-weight: 700;
  color: #475569;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  line-height: 1.2;
  margin-top: 2rem;
}

.education-major {
  color: #475569;
  font-size: 0.75rem;
  font-weight: 500;
  display: block;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.education-school {
  color: #475569;
  font-weight: 700;
  font-size: 0.75rem;
}

/* Skills & Focus */
.skills-section,
.focus-section {
  margin-bottom: 0;
}

.skills-grid,
.focus-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.skill-tag,
.focus-tag {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #475569;
  background-color: var(--bg-tile);
  border-radius: 0.75rem;
}

/* Responsive Grids */
.projects-grid,
.jobs-grid,
.education-cards-wrapper,
.skills-grid,
.focus-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {

  .projects-grid,
  .jobs-grid,
  .education-cards-wrapper,
  .skills-grid,
  .focus-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1680px) {

  .projects-grid,
  .jobs-grid,
  .education-cards-wrapper,
  .skills-grid,
  .focus-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.modal {
  max-width: 900px;
}

@media (min-width: 1024px) {
  .modal {
    max-width: 1100px;
  }
}

@media (min-width: 1640px) {
  .modal {
    max-width: 1580px;
  }
}

/* Animated Background */
#animated-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  /* Changed from -1 to 0, content is now z-index 1 */
  overflow: hidden;
  pointer-events: none;
  background-color: #f8fafc;
}

.bg-block {
  position: absolute;
  /* background-color removed, now handled by internal bars */
  opacity: 0;
  border-radius: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bg-bar {
  width: 100%;
  /* Height will be set inline */
}

/* Color variations applied to bars */
.bg-bar.color-1 {
  background-color: rgba(59, 130, 246, 0.4);
  /* Blue */
}

.bg-bar.color-2 {
  background-color: rgba(29, 78, 216, 0.5);
  /* Darker Blue */
}

.bg-bar.color-3 {
  background-color: rgba(255, 255, 255, 0.9);
  /* White */
}

.bg-bar.color-4 {
  background-color: rgba(147, 197, 253, 0.8);
}

/* Light Blue/White */

/* Glitchy movement - using steps and rapid changes */
/* Glitchy movement - using steps and rapid changes */
/* "Lose the wobbling" - removed translations, kept opacity flickers */
@keyframes flicker {
  0% {
    opacity: 0;
  }

  10% {
    opacity: var(--target-opacity);
  }

  20% {
    opacity: 0;
  }

  30% {
    opacity: var(--target-opacity);
  }

  50% {
    opacity: 0.1;
  }

  70% {
    opacity: var(--target-opacity);
  }

  90% {
    opacity: 0;
  }

  100% {
    opacity: 0;
  }
}

@keyframes flickerSlow {
  0% {
    opacity: 0;
  }

  20% {
    opacity: var(--target-opacity);
  }

  40% {
    opacity: 0.2;
  }

  60% {
    opacity: var(--target-opacity);
  }

  80% {
    opacity: 0.1;
  }

  100% {
    opacity: 0;
  }
}

@keyframes flickerFast {
  0% {
    opacity: 0;
  }

  10% {
    opacity: var(--target-opacity);
  }

  15% {
    opacity: 0;
  }

  20% {
    opacity: var(--target-opacity);
  }

  25% {
    opacity: 0;
  }

  30% {
    opacity: var(--target-opacity);
  }

  100% {
    opacity: 0;
  }
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: color-mix(in srgb, var(--bg-main) 75%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 68px 2rem 0 2rem;
}

@media (max-width: 767px) {
  .modal-overlay {
    padding: 0;
  }

  .modal-nav {
    display: none;
  }
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background-color: var(--bg-main);
  border-radius: 0.75rem 0.75rem 0 0;
  max-width: 1440px;
  width: 100%;
  height: calc(100vh - 68px);
  max-height: none;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: modalFadeIn 0.3s ease-out;
  position: relative;
  display: flex;
  flex-direction: column;
}



@media (min-width: 1024px) {
  .modal {
    max-width: 1440px;
  }
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem;
  padding-bottom: 4rem;
  background: linear-gradient(to bottom, var(--bg-main) 0%, var(--bg-main) 30%, transparent 100%);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  pointer-events: none;
}

.modal-header>* {
  pointer-events: auto;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #000;
}

.modal-close {
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  color: #6b7280;
  transition: all 0.2s;
}

.modal-close:hover {
  background-color: var(--bg-main);
  color: #000;
}

.modal-body {
  padding: 6rem 2rem 2rem 2rem;
  overflow-y: auto;
  flex-grow: 1;
  height: auto;
  max-height: none;
}

.modal-section {
  margin-bottom: 2rem;
}

.modal-section:first-child {
  padding-top: 0;
  margin-top: 0;
}

.modal-section h3 {
  font-size: 1rem;
  font-weight: 800;
  color: #000;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.modal-section p {
  color: #000;
  line-height: 1.6;
  font-size: 0.875rem;
}

.modal-images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.modal-images img {
  width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.modal-text p {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
}

.modal-text h3 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.modal-two-column {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .modal-two-column {
    grid-template-columns: 1fr 1fr;
  }
}

.modal-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background-color: transparent;
  border: none;
  padding: 2rem;
  cursor: pointer;
  color: #000;
  transition: all 0.2s;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-nav::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: transparent;
  border: 1px solid rgba(0, 0, 0, 0.25);
  transition: all 0.2s;
  z-index: -1;
}

.modal-nav:hover::before {
  background-color: var(--accent);
  border-color: transparent;
}

.modal-nav-prev {
  left: 0;
}

.modal-nav-next {
  right: 0;
}

.modal-nav:disabled {
  opacity: 0.2;
  cursor: not-allowed;
}

.modal-nav:disabled:hover::before {
  background-color: transparent;
  border-color: rgba(0, 0, 0, 0.25);
}

.modal-image-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}

.modal-expand-icon {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  color: #d1d5db;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.modal-image-wrapper:hover .modal-expand-icon {
  opacity: 1;
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 2rem;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  padding: 0.5rem;
  border-radius: 0.375rem;
  cursor: pointer;
  color: #fff;
  transition: all 0.2s;
  z-index: 201;
}

.lightbox-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

#lightbox-image {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 0.5rem;
}