@import './theme.css';

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--color-foreground);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

ul {
  list-style: none;
}

/* Container utilities */
.container {
  max-width: 80rem; /* max-w-7xl */
  margin: 0 auto;
  padding: 0 1.5rem; /* px-6 */
}

@media (min-width: 768px) {
  .container {
    padding: 0 3rem; /* md:px-12 */
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 6rem; /* lg:px-24 */
  }
}

/* Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 101;
  padding-top: env(safe-area-inset-top, 0px);
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.header.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}


.nav-container {
  max-width: 80rem;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
}

@media (min-width: 768px) {
  .nav-container {
    padding: 1rem 3rem;
  }
}

@media (min-width: 1024px) {
  .nav-container {
    padding: 1rem 0.5rem;
  }
}

.nav-logo {
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-lg);
  letter-spacing: -0.01em;
  transition: opacity 0.3s ease;
  /* ALIGNMENT CHANGE - can rollback: Added max-width to align with hero headline (56rem) */
  max-width: 56rem;
}

.nav-logo.hidden {
  display: none;
}

.nav-back-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  color: var(--color-foreground);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
  font-family: inherit;
}

.nav-back-button:hover {
  border-color: var(--color-accent-dark);
  color: var(--color-accent-dark);
  background-color: var(--color-accent-soft);
}

.nav-back-button svg {
  flex-shrink: 0;
  display: block;
  margin: 0 auto;
}

.nav-back-button.hidden {
  display: none !important;
}

@media (max-width: 767.98px) {
  .nav-container {
    padding: 1rem 1rem;
  }
  
  /* Hide back button by default */
  .nav-back-button {
    display: none !important;
  }
  
  /* Show back button when menu is active */
  .header.menu-active .nav-back-button {
    display: flex !important;
  }
  
  /* Show back button when detail page is active (allows inline style override) */
  .header.detail-page-active .nav-back-button {
    display: flex !important;
  }
  
  /* Allow inline style to override when explicitly set by JavaScript */
  .nav-back-button[style*="display: inline-flex"],
  .nav-back-button[style*="display: flex"] {
    display: flex !important;
  }
  
  .nav-back-button {
    padding: 0 !important;
    font-size: var(--text-sm);
    gap: 0 !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 50% !important;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.2s ease;
  }
  
  .nav-back-button:hover {
    background-color: var(--color-background) !important;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3) !important;
    border-color: var(--color-border) !important;
  }
  
  .nav-back-button:active {
    transform: scale(0.95);
  }
  
  .nav-back-button svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
    margin: 0 !important;
    flex-shrink: 0;
  }
  
  .nav-back-button span {
    display: none; /* Hide text on mobile, show only icon */
  }
  
  /* Hide hamburger toggle when menu is open (show X button instead) */
  .header.menu-active .nav-toggle {
    display: none !important;
  }
  
  /* Ensure back button is positioned correctly */
  .header.menu-active .nav-back-button {
    order: 2; /* Position after logo, before menu */
  }
  
  .nav-logo {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Hide nav menu and toggle on detail pages */
.header.detail-page-active .nav-menu,
.header.detail-page-active .nav-toggle {
  display: none !important;
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background-color: var(--color-foreground);
  transition: all 0.3s ease;
}

@media (min-width: 768px) {
  .nav-toggle {
    display: none;
  }
}

.nav-menu {
  display: none;
  flex-direction: column;
  gap: 1rem;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: var(--color-background);
  border-bottom: 1px solid var(--color-border);
  padding: 1.5rem;
}

.nav-menu.active {
  display: flex;
}

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
    flex-direction: row;
    position: static;
    border: none;
    padding: 0;
    gap: 2rem;
    background-color: transparent;
  }
}

.nav-link {
  color: var(--color-muted-foreground);
  transition: color var(--duration-fast) var(--ease-out);
  font-size: var(--text-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-accent-dark);
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: var(--space-24) var(--space-6);
}

@media (min-width: 768px) {
  .hero {
    padding: 4rem 3rem;
  }
}

@media (min-width: 1024px) {
  .hero {
    padding: 4rem 6rem;
  }
}

.hero-container {
  max-width: 80rem;
  margin: 0 auto;
  width: 100%;
  overflow: hidden;
}

.hero-content {
  /* ALIGNMENT CHANGE - can rollback: Removed max-width constraint to allow content to align with nav logo */
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  max-width: 100%;
  overflow: hidden;
}

.hero-headline {
  font-size: var(--text-5xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.15;
  max-width: 56rem;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .hero-headline {
    font-size: var(--text-7xl);
  }
}

@media (min-width: 1024px) {
  .hero-headline {
    font-size: 64px;
  }
}

.hero-intro {
  font-size: var(--text-xl);
  color: var(--color-muted-foreground);
  /* ALIGNMENT CHANGE - can rollback: Changed from 48rem to 56rem to align with nav logo and headline */
  max-width: 56rem;
  line-height: 1.75;
  font-weight: var(--font-weight-normal);
}

@media (min-width: 768px) {
  .hero-intro {
    font-size: var(--text-2xl);
    line-height: 1.7;
  }
}

.hero-intro + .hero-intro {
  margin-top: 0.5rem;
}

.hero-scroll {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-muted-foreground);
  margin-top: 2rem;
  transition: color 0.2s ease;
}

.hero-scroll:hover {
  color: var(--color-accent-dark);
}

.hero-scroll svg {
  transition: transform 0.2s ease;
}

.hero-scroll:hover svg {
  transform: translateY(4px);
}

/* LOGO MARQUEE - START (remove this section to disable) */
.logo-marquee {
  margin-top: 3rem;
  margin-bottom: 0;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
  position: relative;
  height: 3rem;
  max-height: 3rem;
}

.logo-marquee-track {
  display: flex;
  width: fit-content;
  animation: logoMarquee 20s linear infinite;
  gap: 4rem;
  height: 3rem;
  max-height: 3rem;
  align-items: center;
}

.logo-marquee-group {
  display: flex;
  align-items: center;
  gap: 4rem;
  flex-shrink: 0;
  height: 3rem;
  max-height: 3rem;
}

.logo-marquee-item {
  height: 2.5rem !important;
  max-height: 2.5rem !important;
  width: auto !important;
  max-width: 200px !important;
  min-width: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  opacity: 0.7;
  transition: opacity 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
  display: block;
  overflow: hidden;
}

.logo-marquee-item:hover {
  opacity: 1;
  transform: scale(1.05);
}

.logo-marquee-item-binck {
  height: 2.5rem !important;
  max-height: 2.5rem !important;
  width: auto !important;
  max-width: 200px !important;
  object-fit: contain !important;
  object-position: center;
}

.logo-marquee-item-lostboys {
  height: 3.5rem !important;
  max-height: 3.5rem !important;
  width: auto !important;
  max-width: 200px !important;
  object-fit: contain !important;
  object-position: center;
}

@media (max-width: 767.98px) {
  .logo-marquee-item-binck {
    height: 2rem !important;
  }
  
  .logo-marquee-item-lostboys {
    height: 2.5rem !important;
  }
}

@keyframes logoMarquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(var(--marquee-move-distance, -50%));
  }
}

@media (prefers-reduced-motion: reduce) {
  .logo-marquee-track {
    animation: none;
  }
  
  .logo-marquee-group:last-child {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .logo-marquee {
    margin-top: 2rem;
  }
  
  .logo-marquee-item {
    height: 2rem;
    max-height: 2rem;
    max-width: 150px;
  }
  
  .logo-marquee-track {
    gap: 3rem;
  }
  
  .logo-marquee-group {
    gap: 3rem;
  }
}
/* LOGO MARQUEE - END */

/* Work Section */
.work {
  padding: 3rem 1rem;
  display: block;
  scroll-margin-top: 60px;
}

@media (min-width: 768px) {
  .work {
    padding: 6rem 3rem;
  }
}

@media (min-width: 1024px) {
  .work {
    padding: 6rem 6rem;
  }
}

.work-container {
  max-width: 80rem;
  margin: 0 auto;
}

.work-header {
  margin-bottom: 4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-x: hidden;
  width: 100%;
}

@media (max-width: 767.98px) {
  .work-header {
    margin-bottom: 2rem;
    gap: 0.75rem;
  }
}

.work-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-semibold);
  max-width: 48rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .work-title {
    font-size: var(--text-5xl);
    line-height: 1.15;
  }
}

.work-subtitle {
  font-size: var(--text-xl);
  color: var(--color-muted-foreground);
  max-width: 32rem;
  line-height: 1.7;
  font-weight: var(--font-weight-normal);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (min-width: 768px) {
  .work-subtitle {
    display: flex;
    flex-wrap: nowrap;
    white-space: nowrap;
    max-width: 40rem;
  }
}

@media (max-width: 767.98px) {
  .work-subtitle {
    max-width: 100%;
    width: 100%;
    white-space: normal;
    box-sizing: border-box;
    padding-right: 0;
  }
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: stretch;
}

@media (max-width: 767.98px) {
  .projects-grid {
    gap: 1.5rem;
  }
}

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

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

.project-card-overview {
  display: flex;
  flex-direction: column;
  background-color: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-card-overview:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  border-color: var(--color-accent-dark);
}

.project-image-wrapper {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background-color: var(--color-muted);
}

.project-image-wrapper:empty {
  display: none;
}

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

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

.project-card-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: var(--space-6);
  flex: 1;
}

@media (min-width: 768px) {
  .project-card-content {
    padding: 2rem 2rem 2.5rem 2rem;
  }
}

@media (min-width: 1024px) {
  .project-card-content {
    padding: 2.5rem 2.5rem 3rem 2.5rem;
  }
}

.project-title {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.project-description {
  font-size: var(--text-lg);
  color: var(--color-muted-foreground);
  line-height: 1.6;
}

.project-outcome {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-border);
}

.project-outcome-label {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-accent);
  font-weight: var(--font-weight-medium);
}

.project-outcome-text {
  font-size: var(--text-sm);
  color: var(--color-foreground);
  line-height: 1.6;
}

ul.project-outcome-text {
  list-style: disc;
  padding-left: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1.5rem;
  margin-top: 0;
}

.project-tag {
  padding: 0.25rem 0.75rem;
  background-color: var(--color-accent-soft);
  color: var(--color-accent-dark);
  border-radius: 9999px;
  font-size: var(--text-sm);
  transition: background-color 0.2s ease, color 0.2s ease;
  font-weight: var(--font-weight-normal);
  border: none;
}

.project-tag:hover {
  background-color: var(--color-accent);
  color: var(--color-accent-foreground);
}

.project-read-link {
  display: inline-flex;
  align-items: center;
  margin-top: auto;
  margin-bottom: 1.5rem;
  color: var(--color-accent-dark);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  position: relative;
  min-height: 44px;
  justify-content: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0px;
  text-decoration: none;
  transition: color 0.2s, gap 0.2s;
}

.project-read-link::after {
  content: '→';
  display: inline-block;
  color: var(--color-accent-dark);
  font-size: var(--text-base);
  transition: transform 0.2s ease;
}

.project-read-link:hover {
  color: var(--color-accent);
  gap: 0.75rem;
}

.project-read-link:hover::after {
  transform: translateX(4px);
}

.project-detail-header-teal .project-tag {
  background-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.95);
  border: none;
}

.project-detail-header-teal .project-tag:hover {
  background-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* Project Detail Page */
.project-detail-page {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  padding: 0 1.5rem 1rem 1.5rem;
  background-color: var(--color-background);
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.project-detail-page.active {
  display: block;
}

/* Hide main page content when detail page is active */
body.detail-page-open section:not(.project-detail-page) {
  display: none !important;
}

body.detail-page-open footer {
  display: none !important;
}

/* Space below overlay bar (close button): header height + gap so title doesn’t touch bar */
.project-detail-page.active {
  padding-top: calc(60px + env(safe-area-inset-top, 0px) + 1.5rem);
}

.project-detail-page.has-sticky-outcomes.active {
  padding-top: calc(60px + env(safe-area-inset-top, 0px) + 1.5rem);
}

.project-detail-container {
  max-width: 56rem;
  margin: 0 auto;
  padding-top: 0;
}

.project-back-button {
  display: none; /* Hide the old back button since we're using header button now */
}

.project-back-button:hover {
  border-color: var(--color-accent-dark);
  color: var(--color-accent-dark);
  background-color: rgba(217, 236, 238, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.project-back-button svg {
  flex-shrink: 0;
}

.project-detail-content {
  padding: 0;
  margin-top: 0;
}

.project-detail-content > .project-detail-header-teal + * {
  margin-top: 0;
}

.project-detail-content > .project-detail-header-teal ~ .project-detail-image,
.project-detail-content > .project-detail-header-teal ~ .carousel-container {
  margin-top: 4rem;
}

.project-detail-header-teal-content {
  padding-bottom: 3rem;
}

@media (min-width: 768px) {
  .project-detail-header-teal-content {
    padding-bottom: 4rem;
  }
}


.project-detail-image {
  width: 100%;
  max-width: 100%;
  object-fit: contain;
  border-radius: var(--radius-lg);
  display: block;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.project-detail-image:hover {
  opacity: 0.9;
}

.project-detail-image-wrapper {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.project-detail-image-zoom-hint {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 10;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.project-detail-image-wrapper:hover .project-detail-image-zoom-hint {
  opacity: 1;
  transform: scale(1.05);
}

.project-detail-image-zoom-hint svg {
  width: 20px;
  height: 20px;
  color: #ffffff;
  stroke-width: 2.5;
}

@media (max-width: 767.98px) {
  .project-detail-image-zoom-hint {
    width: 36px;
    height: 36px;
    top: 0.75rem;
    right: 0.75rem;
  }
  
  .project-detail-image-zoom-hint svg {
    width: 18px;
    height: 18px;
  }
}

.project-detail-images {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.project-detail-images .project-detail-image {
  margin-bottom: 0;
}

.project-detail-images .project-detail-image:last-child {
  margin-bottom: 2rem;
}

/* Carousel Styles */
.carousel-container {
  position: relative;
  width: 100%;
  margin-top: 3rem;
  margin-bottom: 3rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* Ensure carousel has minimum visible area before images load */
  min-height: 400px;
}

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

.carousel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  transition: opacity 0.4s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-slide.active {
  opacity: 1;
  position: relative;
}

.carousel-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: opacity 0.2s ease;
  position: relative;
}

.carousel-image:hover {
  opacity: 0.9;
}

.carousel-image-zoom-hint {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 11;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.carousel-slide:hover .carousel-image-zoom-hint {
  opacity: 1;
  transform: scale(1.05);
}

.carousel-image-zoom-hint svg {
  width: 20px;
  height: 20px;
  color: #ffffff;
  stroke-width: 2.5;
}

@media (max-width: 767.98px) {
  .carousel-image-zoom-hint {
    width: 36px;
    height: 36px;
    top: 0.75rem;
    right: 0.75rem;
  }
  
  .carousel-image-zoom-hint svg {
    width: 18px;
    height: 18px;
  }
}

.carousel-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  /* Standard touch target size for mobile accessibility */
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  color: var(--color-foreground);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-button:hover {
  background-color: var(--color-background);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-50%) scale(1.05);
}

.carousel-button:active {
  transform: translateY(-50%) scale(0.95);
}

.carousel-button-prev {
  left: 1rem;
}

.carousel-button-next {
  right: 1rem;
}

.carousel-button svg {
  width: 20px;
  height: 20px;
}

.carousel-indicators {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  margin-top: 1rem;
}

.carousel-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-muted-foreground);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  opacity: 0.4;
}

.carousel-indicator:hover {
  opacity: 0.7;
  transform: scale(1.2);
}

.carousel-indicator.active {
  opacity: 1;
  background-color: var(--color-accent);
  width: 24px;
  border-radius: 4px;
}

@media (max-width: 767.98px) {
  .carousel-button {
    /* Standard touch target size for mobile accessibility */
    width: 40px;
    height: 40px;
  }
  
  .carousel-button svg {
    width: 18px;
    height: 18px;
  }
  
  .carousel-button-prev {
    left: 0.5rem;
  }
  
  .carousel-button-next {
    right: 0.5rem;
  }
}

/* LIGHTBOX - START */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  padding: 2rem;
  box-sizing: border-box;
}

.lightbox-overlay.active {
  opacity: 1;
  visibility: visible;
}

.lightbox-container {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-image {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  transition: all 0.2s ease;
  color: var(--color-foreground);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lightbox-close:hover {
  background-color: var(--color-background);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lightbox-close:active {
  transform: scale(0.95);
}

.lightbox-close svg {
  width: 24px;
  height: 24px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1001;
  transition: all 0.2s ease;
  color: var(--color-foreground);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.lightbox-nav:hover {
  background-color: var(--color-background);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.lightbox-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.lightbox-nav svg {
  width: 24px;
  height: 24px;
}

.lightbox-nav-prev {
  left: 1rem;
}

.lightbox-nav-next {
  right: 1rem;
}

.lightbox-nav.hidden {
  display: none;
}

.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(255, 255, 255, 0.9);
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  font-size: var(--text-sm);
  color: var(--color-foreground);
  font-weight: var(--font-weight-medium);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 1001;
}

.lightbox-counter.hidden {
  display: none;
}

@media (max-width: 767.98px) {
  .lightbox-overlay {
    padding: 1rem;
  }
  
  .lightbox-close {
    width: 40px;
    height: 40px;
    top: 0.5rem;
    right: 0.5rem;
  }
  
  .lightbox-close svg {
    width: 20px;
    height: 20px;
  }
  
  .lightbox-nav {
    width: 40px;
    height: 40px;
  }
  
  .lightbox-nav svg {
    width: 20px;
    height: 20px;
  }
  
  .lightbox-nav-prev {
    left: 0.5rem;
  }
  
  .lightbox-nav-next {
    right: 0.5rem;
  }
  
  .lightbox-counter {
    bottom: 0.5rem;
    font-size: var(--text-xs);
    padding: 0.375rem 0.75rem;
  }
}

/* Prevent body scroll when lightbox is open */
body.lightbox-open {
  overflow: hidden;
}
/* LIGHTBOX - END */

.project-detail-header {
  margin-bottom: 0;
  margin-top: 0;
  padding: 0;
  position: relative;
}

.project-detail-header-top {
  margin-bottom: 0;
  padding: 0;
}

.project-detail-header-teal {
  background-color: var(--color-accent);
  color: #ffffff;
  padding: 3rem 0;
  margin: 0 calc(-50vw + 50%);
  width: 100vw;
  margin-bottom: 0;
}

.project-detail-header-teal-content {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem 3rem 1.5rem;
}

@media (min-width: 768px) {
  .project-detail-header-teal {
    padding: 4rem 0;
  }
  
  .project-detail-header-teal-content {
    padding: 0 3rem 4rem 3rem;
  }
}

@media (min-width: 1024px) {
  .project-detail-header-teal-content {
    padding: 0 6rem 4rem 6rem;
  }
}

.project-detail-header-content {
  flex: 1;
  min-width: 0;
}

@media (max-width: 1023px) {
  .project-detail-header-content {
    width: 100%;
  }
}

.project-detail-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 1rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .project-detail-title {
    font-size: var(--text-5xl);
  }
}

.project-detail-description {
  font-size: var(--text-2xl);
  color: var(--color-muted-foreground);
  line-height: 1.75;
  font-weight: var(--font-weight-normal);
}

.project-detail-sections {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 2rem;
}

.project-detail-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-detail-section-label {
  font-size: var(--text-base);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  font-weight: var(--font-weight-medium);
  margin-bottom: 0.5rem;
  margin-top: 0.5rem;
}

.project-detail-section {
  /* Remove hover shift to prevent text moving horizontally */
  transition: none;
}

.project-detail-section-text {
  font-size: var(--text-xl);
  color: var(--color-foreground);
  line-height: 1.85;
  font-weight: var(--font-weight-normal);
}

.project-detail-section-text p {
  font-size: var(--text-xl);
  line-height: 1.85;
  margin-bottom: 1.5rem;
  font-weight: var(--font-weight-normal);
}

.project-detail-section-text strong {
  font-weight: var(--font-weight-semibold);
}

.project-detail-section-text ul {
  list-style: none;
  padding-left: 0;
  margin: 0 0 1.5rem 0;
}

.project-detail-section-text ul li {
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: 1.5rem;
  font-size: var(--text-xl);
  line-height: 1.85;
  font-weight: var(--font-weight-normal);
}

.project-detail-section-text ul li:before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: var(--font-weight-medium);
  font-size: var(--text-2xl);
  line-height: 1;
}

.project-detail-section-full {
  width: 100%;
  grid-column: 1 / -1;
}

/* Add visual break between consecutive sections */
.project-detail-section-full + .project-detail-section-full {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--color-border);
}

.project-detail-outcome {
  grid-column: 1 / -1;
  margin-top: 4rem;
  padding: 0;
}

/* Comparison Layout */
.project-detail-comparison {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

@media (min-width: 1024px) {
  .project-detail-comparison {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

.project-detail-comparison-view {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.project-detail-comparison-label {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted-foreground);
  font-weight: var(--font-weight-medium);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-border);
}

.project-detail-comparison .project-detail-tags {
  grid-column: 1 / -1;
  margin-top: 2rem;
}


/* E: Top-Right Card */
.project-detail-header-with-card {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  justify-content: space-between;
}

.project-detail-outcome-top-right-card {
  flex-shrink: 0;
}

.project-detail-outcome-top-right-card-compact {
  width: 280px;
  background-color: var(--color-accent);
  color: #ffffff;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.project-detail-outcome-top-right-card-title {
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: #ffffff;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.project-detail-outcome-top-right-card-metric {
  margin-bottom: 0;
}

.project-detail-outcome-top-right-card-metric-value {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  color: #ffffff;
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
  animation: gentlePulse 3s ease-in-out infinite;
}

@keyframes gentlePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.95;
  }
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .project-detail-outcome-top-right-card-metric-value {
    animation: none;
  }
}

.project-detail-outcome-top-right-card-metric-label {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.9);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
}

.project-detail-outcome-top-right-card-view-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  transition: opacity 0.2s ease;
  cursor: pointer;
}

.project-detail-outcome-top-right-card-view-more:hover {
  opacity: 0.9;
}

.project-detail-outcome-top-right-card-arrow {
  flex-shrink: 0;
  animation: pulseArrow 2s ease-in-out infinite;
}

@keyframes pulseArrow {
  0%, 100% {
    transform: translateY(0);
    opacity: 1;
  }
  50% {
    transform: translateY(4px);
    opacity: 0.8;
  }
}

.project-detail-outcome-full-section {
  margin-top: 4rem;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
  padding: 3rem 1.5rem;
  background-color: var(--color-accent);
  color: #ffffff;
  scroll-margin-top: 80px; /* Offset for sticky header + padding */
}

.project-detail-outcome-full-section-content {
  max-width: 56rem;
  margin: 0 auto;
}

.project-detail-outcome-full-section .project-detail-outcome-title {
  color: #ffffff;
}

.project-detail-outcome-full-section .project-detail-outcome-metric-value {
  color: #ffffff;
}

.project-detail-outcome-full-section .project-detail-outcome-metric-description {
  color: rgba(255, 255, 255, 0.9);
}

.project-detail-outcome-full-section .project-detail-outcome-changes-title {
  color: #ffffff;
}

.project-detail-outcome-full-section .project-detail-outcome-changes-list li {
  color: rgba(255, 255, 255, 0.95);
}

.project-detail-outcome-full-section .project-detail-outcome-changes-list li:before {
  color: #ffffff;
}

/* What I learned section base styles */
.project-detail-outcome-learned {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.project-detail-outcome-learned-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-foreground);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.project-detail-outcome-learned-text {
  font-size: var(--text-xl);
  color: var(--color-foreground);
  line-height: 1.7;
  font-weight: 400;
}

.project-detail-outcome-full-section .project-detail-outcome-learned-title {
  color: #ffffff;
}

.project-detail-outcome-full-section .project-detail-outcome-learned-text {
  color: rgba(255, 255, 255, 0.95);
}

@media (min-width: 768px) {
  .project-detail-outcome-full-section {
    padding: 4rem 3rem;
  }
}

@media (min-width: 1024px) {
  .project-detail-outcome-full-section {
    padding: 4rem 6rem;
  }
}

@media (max-width: 1023px) {
  .project-detail-header-with-card {
    flex-direction: column;
  }
  
  .project-detail-outcome-top-right-card {
    width: 100%;
  }
  
  .project-detail-outcome-top-right-card-compact {
    width: 100%;
  }
}

@media (max-width: 767.98px) {
  .project-detail-outcome-top-right-card-compact {
    padding: 1.5rem;
  }
  
  .project-detail-outcome-top-right-card-metric-value {
    font-size: var(--text-3xl);
  }
}

/* Compact layout - grouped sections */
.project-detail-compact .project-detail-section {
  margin-bottom: 1rem;
}

.project-detail-compact .project-detail-section-label {
  margin-bottom: 0.25rem;
}

.project-detail-compact .project-detail-section-text {
  font-size: var(--text-lg);
  line-height: 1.7;
}

.project-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.project-detail-header-teal .project-detail-tags {
  margin-top: 2rem;
}

/* Case Navigation in Main Content */
.project-detail-case-navigation {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.project-detail-header-teal .project-detail-case-navigation {
  border-top-color: rgba(255, 255, 255, 0.2);
}

.project-detail-case-nav-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0;
  background: none;
  border: none;
  color: var(--color-muted-foreground);
  font-size: var(--text-base);
  font-weight: var(--font-weight-normal);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
}

.project-detail-case-nav-button:hover {
  color: var(--color-accent-dark);
}

.project-detail-header-teal .project-detail-case-nav-button {
  color: rgba(255, 255, 255, 0.9);
}

.project-detail-header-teal .project-detail-case-nav-button:hover {
  color: #ffffff;
}

.project-detail-case-nav-button:active {
  opacity: 0.8;
}

.project-detail-case-nav-button svg {
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.6;
}

.project-detail-case-nav-button:hover svg {
  opacity: 1;
  transform: translateX(-3px);
}

.project-detail-case-nav-button-next:hover svg {
  transform: translateX(3px);
}

.project-detail-header-teal .project-detail-case-nav-button svg {
  opacity: 0.8;
  stroke: rgba(255, 255, 255, 0.9);
}

.project-detail-header-teal .project-detail-case-nav-button:hover svg {
  opacity: 1;
  stroke: #ffffff;
}

.project-detail-case-nav-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  text-align: left;
}

.project-detail-case-nav-button-next {
  margin-left: auto;
}

.project-detail-case-nav-button-next .project-detail-case-nav-content {
  text-align: right;
  align-items: flex-end;
}

.project-detail-case-nav-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted-foreground);
  font-weight: var(--font-weight-medium);
}

.project-detail-case-nav-button:hover .project-detail-case-nav-label {
  color: var(--color-accent-dark);
}

.project-detail-header-teal .project-detail-case-nav-label {
  color: rgba(255, 255, 255, 0.8);
}

.project-detail-header-teal .project-detail-case-nav-button:hover .project-detail-case-nav-label {
  color: rgba(255, 255, 255, 0.95);
}

.project-detail-case-nav-title {
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
  color: var(--color-foreground);
  max-width: 20rem;
}

.project-detail-header-teal .project-detail-case-nav-title {
  color: #ffffff;
}

@media (max-width: 767.98px) {
  .project-detail-case-navigation {
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .project-detail-case-nav-button-next {
    margin-left: 0;
  }
  
  .project-detail-case-nav-button-next .project-detail-case-nav-content {
    text-align: left;
    align-items: flex-start;
  }
  
  .project-detail-case-nav-button-next {
    flex-direction: row-reverse;
  }
  
  .project-detail-case-nav-title {
    max-width: 100%;
  }
}

.project-detail-outcome-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-foreground);
  margin-bottom: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.project-detail-outcome-intro {
  font-size: var(--text-xl);
  color: var(--color-foreground);
  line-height: 1.75;
  font-weight: var(--font-weight-normal);
  margin-bottom: 3rem;
  max-width: 48rem;
}

.project-detail-outcome-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

@media (min-width: 768px) {
  .project-detail-outcome-metrics {
    grid-template-columns: repeat(3, 1fr);
    gap: 3rem;
  }
}

.project-detail-outcome-metric {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-detail-outcome-metric-value {
  font-size: var(--text-5xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-foreground);
  line-height: 1;
  letter-spacing: -0.02em;
}

.project-detail-outcome-metric-description {
  font-size: var(--text-base);
  color: var(--color-foreground);
  font-weight: var(--font-weight-medium);
  line-height: 1.5;
}

.project-detail-outcome-changes {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.project-detail-outcome-changes-title {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-foreground);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.project-detail-outcome-changes-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.project-detail-outcome-changes-list li {
  position: relative;
  padding-left: 1.5rem;
  font-size: var(--text-xl);
  color: var(--color-foreground);
  line-height: 1.7;
  font-weight: 400;
}

.project-detail-outcome-changes-list li:before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--color-foreground);
  font-weight: 500;
  font-size: var(--text-xl);
  line-height: 1.7;
}

.project-detail-outcome-label {
  font-size: var(--text-lg);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 1.5rem;
}

.project-detail-outcome-text {
  font-size: var(--text-xl);
  color: var(--color-foreground);
  line-height: 1.85;
  font-weight: var(--font-weight-normal);
}

.project-detail-outcome-text p {
  font-size: var(--text-xl);
  line-height: 1.85;
  margin-bottom: 1.5rem;
  font-weight: var(--font-weight-normal);
}

.project-detail-outcome-text strong {
  font-weight: var(--font-weight-semibold);
}

.project-detail-outcome-text ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.project-detail-outcome-text ul li {
  position: relative;
  padding-left: 2.25rem;
  margin-bottom: 1rem;
  font-size: var(--text-xl);
  line-height: 1.85;
  font-weight: var(--font-weight-normal);
}

.project-detail-outcome-text ul li:before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--color-accent);
  font-weight: var(--font-weight-semibold);
  font-size: var(--text-2xl);
  line-height: 1;
}

@media (min-width: 768px) {
  .project-detail-page {
    padding: 3rem;
  }
  
  .project-detail-page.active {
    padding-top: calc(3rem + 60px + env(safe-area-inset-top, 0px) + 1.5rem);
  }
  
  .project-detail-page.has-sticky-outcomes.active {
    padding-top: calc(3rem + 60px + env(safe-area-inset-top, 0px) + 1.5rem);
  }
  
  .project-detail-title {
    font-size: var(--text-5xl);
  }
  
  .project-detail-sections:not(.project-detail-compact) {
    grid-template-columns: repeat(2, 1fr);
    display: grid;
  }
  
  .project-detail-compact .project-detail-sections {
    display: flex;
    flex-direction: column;
  }
}

/* Testimonials Section */
.testimonials {
  padding: 3rem 1rem;
  background-color: var(--color-accent);
  color: #ffffff;
}

@media (min-width: 768px) {
  .testimonials {
    padding: 4rem 3rem;
  }
}

@media (min-width: 1024px) {
  .testimonials {
    padding: 4rem 6rem;
  }
}

.testimonials-container {
  max-width: 80rem;
  margin: 0 auto;
}

.testimonials-header {
  margin-bottom: 3rem;
  text-align: center;
}

.testimonials-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #ffffff;
}

@media (min-width: 768px) {
  .testimonials-title {
    font-size: var(--text-5xl);
    line-height: 1.15;
  }
}

.testimonials-carousel {
  position: relative;
  width: 100%;
  /* ALIGNMENT CHANGE - can rollback: Changed from 56rem to 80rem to match wider sections */
  max-width: 80rem;
  margin: 0 auto;
}

.testimonials-wrapper {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* Fixed height prevents layout shift during testimonial transitions */
  height: 280px;
}

@media (min-width: 768px) {
  .testimonials-wrapper {
    height: 240px;
  }
}

.testimonials-slides {
  position: relative;
  width: 100%;
  height: 100%;
  /* Fixed height to match wrapper */
  height: 280px;
}

@media (min-width: 768px) {
  .testimonials-slides {
    height: 240px;
  }
}

.testimonial-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Horizontal padding for arrow buttons on desktop */
  padding: 2rem 5rem;
  /* Ensure content fits within fixed height */
  overflow: hidden;
  box-sizing: border-box;
}

.testimonial-slide.active {
  opacity: 1;
  position: relative;
  /* Use same height as other slides to prevent layout shift */
  height: 100%;
}

.testimonial-quote {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-normal);
  line-height: 1.6;
  color: #ffffff;
  font-style: italic;
  margin-bottom: 1rem;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

@media (min-width: 768px) {
  .testimonial-quote {
    font-size: var(--text-2xl);
    line-height: 1.5;
    max-width: 48rem;
  }
}

.testimonial-author {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-medium);
  color: rgba(255, 255, 255, 0.8);
  font-style: normal;
}

.testimonial-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  transform-origin: center center;
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  /* Standard touch target size for mobile accessibility */
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  max-width: 48px;
  max-height: 48px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
  color: var(--color-foreground);
  box-sizing: border-box;
  backface-visibility: hidden;
  will-change: transform;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.testimonial-button:hover {
  background-color: var(--color-background);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-50%) scale(1.05);
}

.testimonial-button:active {
  transform: translateY(-50%) scale(0.95);
}

.testimonial-button-prev {
  left: 1rem;
}

.testimonial-button-next {
  right: 1rem;
}

.testimonial-button svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 767.98px) {
  /* Hide side arrows on mobile - use indicators instead */
  .testimonial-button {
    display: none !important;
  }
  
  /* Fixed height for mobile to prevent layout shift */
  .testimonials-wrapper {
    height: 300px;
  }
  
  .testimonials-slides {
    height: 300px;
  }
  
  /* More padding since no arrows to avoid */
  .testimonial-slide {
    padding: 1.5rem 1rem;
  }
  
  .testimonial-quote {
    font-size: var(--text-lg);
    line-height: 1.6;
  }
  
  .testimonial-author {
    font-size: var(--text-base);
    margin-top: 0.75rem;
  }
}

.testimonials-indicators {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background-color: var(--color-accent);
  margin-top: 2rem;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  width: 100vw;
}

.testimonial-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
}

.testimonial-indicator:hover {
  background-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.2);
}

.testimonial-indicator.active {
  background-color: #ffffff;
  width: 24px;
  border-radius: 4px;
}

/* About Section */
.about {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 1.5rem;
  scroll-margin-top: 60px;
}

@media (min-width: 768px) {
  .about {
    padding: 6rem 3rem;
  }
}

@media (min-width: 1024px) {
  .about {
    padding: 6rem 6rem;
  }
}

.about-container {
  max-width: 80rem;
  margin: 0 auto;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: center;
  /* ALIGNMENT CHANGE - can rollback: Added max-width 80rem (was unconstrained, using full 80rem container). Matches full width like Recent Work and Experience sections */
  max-width: 80rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .about-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem;
  }
}

.about-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .about-title {
    font-size: var(--text-5xl);
    line-height: 1.15;
  }
}

.about-text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.about-text p {
  color: var(--color-muted-foreground);
  font-size: var(--text-lg);
  line-height: 1.75;
  font-weight: var(--font-weight-normal);
}

.about-focus {
  display: flex;
  flex-direction: column;
}

.focus-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.focus-label {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted-foreground);
  font-weight: var(--font-weight-medium);
}

.focus-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  list-style: none;
  padding-left: 0;
}

@media (min-width: 768px) {
  .focus-list {
    list-style: none;
    padding-left: 0;
  }
}

.focus-list li {
  font-size: var(--text-lg);
  line-height: 1.7;
  font-weight: var(--font-weight-normal);
}

@media (max-width: 767.98px) {
  .focus-list li {
    position: relative;
    padding-left: 1.5rem;
  }
  
  .focus-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--color-foreground);
    font-weight: bold;
    font-size: 1.2em;
  }
}

.profile-photo {
  width: 120px;
  height: 120px;
  min-width: 120px;
  min-height: 120px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center;
  border: 3px solid var(--color-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: block;
  background-color: var(--color-background);
}

@media (min-width: 768px) {
  .profile-photo {
    width: 160px;
    height: 160px;
    min-width: 160px;
    min-height: 160px;
  }
}

/* Experience Section */
.experience {
  padding: 6rem 1.5rem;
  scroll-margin-top: 60px;
}

@media (min-width: 768px) {
  .experience {
    padding: 6rem 3rem;
  }
}

@media (min-width: 1024px) {
  .experience {
    padding: 6rem 6rem;
  }
}

.experience-container {
  max-width: 80rem;
  margin: 0 auto;
}

.experience-header {
  margin-bottom: 4rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.experience-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

@media (min-width: 768px) {
  .experience-title {
    font-size: var(--text-5xl);
    line-height: 1.15;
  }
}

.experience-subtitle {
  font-size: var(--text-xl);
  color: var(--color-muted-foreground);
  line-height: 1.7;
  font-weight: var(--font-weight-normal);
}

.experience-list {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

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

@media (min-width: 768px) {
  .experience-item {
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
  }
}

.experience-meta {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.experience-header-with-logo {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.experience-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.experience-logo {
  width: 3.75rem;
  height: 3.75rem;
  max-width: 60px;
  max-height: 60px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.experience-role {
  font-size: var(--text-xl);
  font-weight: var(--font-weight-semibold);
  line-height: 1.4;
  margin: 0;
}

.experience-company {
  color: var(--color-muted-foreground);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-normal);
  margin: 0;
}

.experience-period {
  color: var(--color-muted-foreground);
  font-size: var(--text-base);
  font-weight: var(--font-weight-normal);
  margin: 0;
}

.experience-description {
  color: var(--color-foreground);
  line-height: 1.75;
}

.experience-description p {
  font-size: var(--text-lg);
  line-height: 1.75;
  font-weight: var(--font-weight-normal);
}

.experience-description ul {
  margin-top: 0.75rem;
  margin-bottom: 0;
  padding-left: 1.5rem;
  list-style-type: disc;
}

.experience-description li {
  font-size: var(--text-lg);
  line-height: 1.75;
  margin-bottom: 0.5rem;
  color: var(--color-foreground);
}

.experience-description li:last-child {
  margin-bottom: 0;
}

/* Contact Section */
.contact {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 1.5rem;
  scroll-margin-top: 60px;
}

@media (max-width: 767.98px) {
  .contact {
    /* Reduced padding on mobile to prevent form from falling off screen */
    padding: 3rem 1rem;
    min-height: auto;
    justify-content: flex-start;
    padding-bottom: 2rem;
  }
}

@media (min-width: 768px) {
  .contact {
    padding: 6rem 3rem;
  }
}

@media (min-width: 1024px) {
  .contact {
    padding: 6rem 6rem;
  }
}

.contact-container {
  max-width: 80rem;
  margin: 0 auto;
}

.contact-content {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

@media (max-width: 767.98px) {
  .contact-content {
    gap: 2rem;
  }
}

.contact-title {
  font-size: var(--text-4xl);
  font-weight: var(--font-weight-semibold);
  /* ALIGNMENT CHANGE - can rollback: Full width on mobile, 80rem on desktop */
  max-width: 100%;
  line-height: 1.4;
  letter-spacing: -0.01em;
  /* Fixed min-height to prevent layout shift when rotating text changes */
  min-height: 1.4em;
}

@media (max-width: 767.98px) {
  .contact-title {
    /* Fixed min-height to prevent layout shift - accommodates rotating text on 2 lines */
    min-height: 4.2em;
  }
}

@media (min-width: 768px) {
  .contact-title {
    font-size: var(--text-5xl);
    line-height: 1.35;
    min-height: 1.35em;
    max-width: 80rem;
  }
}

@media (min-width: 1024px) {
  .contact-title {
    font-size: var(--text-6xl);
    line-height: 1.3;
    min-height: 1.3em;
  }
}

/* Rotating Text Animation */
.rotating-text-wrapper {
  display: inline-block;
  position: relative;
  overflow: visible;
  vertical-align: baseline;
  line-height: 1.4;
  margin-bottom: 0.5em;
  /* Desktop width - will be overridden on mobile */
  width: 450px;
  min-height: 1.4em;
  height: 1.4em;
}

@media (min-width: 768px) {
  .rotating-text-wrapper {
    /* Fixed width large enough for longest text "be more cost effective" */
    width: 450px;
    /* Single line on desktop */
    min-height: 1.4em;
    height: 1.4em;
    overflow: visible;
  }
  
  .rotating-text {
    /* Ensure text displays fully on desktop */
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
  }
}

@media (max-width: 767.98px) {
  .rotating-text-wrapper {
    /* Display as block on mobile to break to new line and prevent gap */
    display: block;
    width: fit-content;
    max-width: 100%;
    /* Fixed height for mobile - accommodates 2 lines to prevent jumping */
    min-height: 2.8em !important;
    height: 2.8em !important;
    line-height: 1.4;
    margin-top: 0.25em;
    margin-bottom: 0.5em;
    overflow: visible;
  }
  
  .rotating-text {
    /* Allow text to wrap on mobile */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: visible;
    text-overflow: clip;
    width: fit-content;
    box-sizing: border-box;
  }
}

.rotating-text {
  display: inline-block;
  background-color: var(--color-accent);
  color: #FFFFFF;
  padding: 0.05em 0.25em;
  transition: opacity 0.4s ease, transform 0.4s ease;
  box-sizing: border-box;
  line-height: 1.4;
  /* Keep text on one line on desktop */
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

@media (max-width: 767.98px) {
  .rotating-text {
    /* Allow text to wrap to 2 lines on mobile */
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: visible;
    text-overflow: clip;
  }
}

.rotating-text.fade-out {
  opacity: 0;
  transform: translateY(-20px);
}

.rotating-text.fade-in {
  opacity: 0;
  transform: translateY(20px);
}


.contact-intro {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: flex-start;
}

@media (max-width: 767.98px) {
  .contact-intro {
    gap: 1.5rem;
  }
}

@media (min-width: 768px) {
  .contact-intro {
    flex-direction: row;
    align-items: flex-start; /* Changed from center to prevent vertical shift */
    gap: 3rem;
  }
}

/* Prevent photo from shifting when text changes */
.contact-photo {
  flex-shrink: 0;
  align-self: flex-start;
}

.contact-subtitle {
  font-size: var(--text-xl);
  color: var(--color-muted-foreground);
  /* ALIGNMENT CHANGE - can rollback: Full width on mobile, full width (80rem) on desktop */
  max-width: 100%;
  line-height: 1.7;
  font-weight: var(--font-weight-normal);
  flex: 1;
}

@media (min-width: 768px) {
  .contact-subtitle {
    max-width: 80rem;
  }
}

.contact-photo {
  flex-shrink: 0;
}

/* Contact Form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  /* ALIGNMENT CHANGE - can rollback: Full width on mobile, full width (80rem) on desktop */
  max-width: 100%;
  padding-top: 1rem;
}

@media (min-width: 768px) {
  .contact-form {
    max-width: 80rem;
  }
}

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

.form-label {
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-foreground);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: var(--text-base);
  font-weight: var(--font-weight-normal);
  line-height: 1.5;
  color: var(--color-foreground);
  background-color: var(--color-input-background);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease, background-color 0.2s ease;
  font-family: inherit;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background-color: var(--color-background);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-muted-foreground);
}

.form-textarea {
  resize: vertical;
  min-height: 8rem;
}

.contact-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--color-accent);
  color: var(--color-accent-foreground);
  border: none;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: opacity 0.2s ease;
  margin-top: 0.5rem;
}

.contact-submit:hover {
  background-color: var(--color-accent-dark);
}

.contact-submit:active {
  opacity: 0.8;
}

.contact-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.contact-submit svg {
  flex-shrink: 0;
}

.form-message {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  margin-top: 0.5rem;
}

.form-message.success {
  background-color: var(--color-accent-soft);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
}

.form-message.error {
  background-color: var(--color-muted);
  color: var(--color-destructive);
  border: 1px solid var(--color-border);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-top: 2rem;
}

.contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  transition: all 0.2s ease;
}

.contact-link-primary {
  background-color: var(--color-accent);
  color: var(--color-accent-foreground);
}

.contact-link-primary:hover {
  background-color: var(--color-accent-dark);
}

.contact-link-secondary {
  border: 1px solid var(--color-border);
  color: var(--color-foreground);
}

.contact-link-secondary:hover {
  border-color: var(--color-muted-foreground);
}

.contact-link svg {
  flex-shrink: 0;
}

/* Footer */
.footer {
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--color-border);
}

@media (min-width: 768px) {
  .footer {
    padding: 2rem 3rem;
  }
}

@media (min-width: 1024px) {
  .footer {
    padding: 2rem 6rem;
  }
}

.footer-container {
  max-width: 80rem;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-text {
  color: var(--color-muted-foreground);
  font-size: var(--text-sm);
}

.footer-linkedin {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-muted-foreground);
  font-size: var(--text-sm);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-linkedin:hover {
  color: var(--color-foreground);
}

.footer-linkedin svg {
  flex-shrink: 0;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Focus styles */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 2px;
}

/* =====================================================
   SCROLL ANIMATIONS
   ===================================================== */

/* Base state for animated elements */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-slower) var(--ease-out), transform var(--duration-slower) var(--ease-out);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for project cards */
.project-card-overview.animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.project-card-overview.animate-on-scroll:nth-child(2) { transition-delay: 100ms; }
.project-card-overview.animate-on-scroll:nth-child(3) { transition-delay: 200ms; }
.project-card-overview.animate-on-scroll:nth-child(4) { transition-delay: 300ms; }
.project-card-overview.animate-on-scroll:nth-child(5) { transition-delay: 400ms; }
.project-card-overview.animate-on-scroll:nth-child(6) { transition-delay: 500ms; }

/* Hero entrance animation */
.hero-content {
  animation: heroFadeIn 1s ease-out forwards;
}

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

/* Staggered hero elements */
.hero-headline {
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.2s forwards;
}

.hero-intro {
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.4s forwards;
}

.hero-scroll {
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.6s forwards;
}

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


/* Section headers animation */
.work-header.animate-on-scroll,
.experience-header.animate-on-scroll,
.about-content.animate-on-scroll {
  transform: translateY(20px);
}

/* Testimonials subtle float animation */
.testimonial-slide.active .testimonial-quote {
  animation: subtleFloat 3s ease-in-out infinite;
}

@keyframes subtleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Experience items stagger */
.experience-item.animate-on-scroll:nth-child(1) { transition-delay: 0ms; }
.experience-item.animate-on-scroll:nth-child(2) { transition-delay: 80ms; }
.experience-item.animate-on-scroll:nth-child(3) { transition-delay: 160ms; }
.experience-item.animate-on-scroll:nth-child(4) { transition-delay: 240ms; }
.experience-item.animate-on-scroll:nth-child(5) { transition-delay: 320ms; }
.experience-item.animate-on-scroll:nth-child(6) { transition-delay: 400ms; }
.experience-item.animate-on-scroll:nth-child(7) { transition-delay: 480ms; }
.experience-item.animate-on-scroll:nth-child(8) { transition-delay: 560ms; }

/* Enhanced hover effects for project cards */
.project-card-overview {
  position: relative;
}

.project-card-overview::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out);
  pointer-events: none;
  background: linear-gradient(
    135deg,
    rgba(var(--color-accent-rgb), 0.03) 0%,
    transparent 50%
  );
}

.project-card-overview:hover::after {
  opacity: 1;
}

/* Subtle shine effect on card hover */
.project-card-overview::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s ease;
  pointer-events: none;
  z-index: 1;
}

.project-card-overview:hover::before {
  left: 100%;
}

/* Contact section subtle animation */
.contact-content {
  position: relative;
}

.contact-title {
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out forwards;
  animation-play-state: paused;
}

.contact-content.is-visible .contact-title {
  animation-play-state: running;
}

.contact-subtitle {
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.15s forwards;
  animation-play-state: paused;
}

.contact-content.is-visible .contact-subtitle {
  animation-play-state: running;
}

.contact-links {
  opacity: 0;
  animation: fadeSlideUp 0.8s ease-out 0.3s forwards;
  animation-play-state: paused;
}

.contact-content.is-visible .contact-links {
  animation-play-state: running;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .animate-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
  
  .hero-headline,
  .hero-intro,
  .hero-scroll,
  .contact-title,
  .contact-subtitle,
  .contact-links {
    opacity: 1;
    animation: none;
  }
  
  .testimonial-slide.active .testimonial-quote {
    animation: none;
  }
  
  .project-card-overview::before {
    display: none;
  }
}


