/* ============================================
   FOLIO THEME - Minimal 2-Column Portfolio
   ============================================ */

/* DESIGN STANDARDS:
   - Use CSS variables for all spacing, colors, and typography.
   - Avoid hardcoded pixel values (e.g., 20px) in layout properties.
   - Prefer rem units for consistent scaling.
*/

/* Custom Fonts */
@font-face {
  font-family: 'Gazpacho';
  src: url('/font/GazpachoRegular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gazpacho';
  src: url('/font/GazpachoMedium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gazpacho';
  src: url('/font/GazpachoBold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Gazpacho';
  src: url('/font/GazpachoBlack.woff2') format('woff2');
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Quablo';
  src: url('/font/Quablo-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}


/* CSS Variables */
:root {
  /* Light Theme Colors */
  --color-bg: #DFDFD7;
  --color-bg-secondary: #ffffff;
  --color-text: #000000;
  --color-text-muted: #666666;
  --color-border: rgba(0, 0, 0, 0.08);
  --color-accent: #000000;

  /* Typography */
  --font-display-gazpacho: 'Gazpacho', Georgia, serif;
  --font-display-quablo: 'Quablo', 'Gazpacho', Georgia, serif;
  --font-display: var(--font-display-quablo);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Sizes */
  --size-xs: 0.75rem;
  --size-sm: 0.875rem;
  --size-base: 1rem;
  --size-lg: 1.125rem;
  --size-xl: 1.25rem;
  --size-2xl: 1.5rem;
  --size-3xl: 2rem;
  --size-4xl: 2.5rem;

  /* Spacing */
  --space-none: 0.5rem;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --section-gap: 2rem;

  /* Layout */
  --sidebar-width: 20rem;
  --sidebar-px: var(--space-lg);
  --max-project-width: 100rem;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 300ms ease;

  /* Border Radii */
  --radius-xl: 2.5rem;
  --radius-l: 1.5rem;
  --radius-m: 1rem;
  --radius-s: 0.75rem;
  --radius-full: 999px;
}





[data-font="gazpacho"] {
  --font-display: var(--font-display-gazpacho);
}

[data-font="quablo"] {
  --font-display: var(--font-display-quablo);
}

/* Font & Header Switcher UI */
.font-switcher,
.header-switcher {
  display: flex;
  gap: 4px;
  background: var(--color-bg-secondary);
  padding: 2px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  align-items: center;
}

.font-switch-btn,
.header-switch-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.font-switch-btn.active,
.header-switch-btn.active {
  background: var(--color-text);
  color: var(--color-bg);
}

/* Centered Header Styles */
/* Centered Header Styles (Now Default) */
.header-content-centered {
  display: flex;
  text-align: center;
  flex-direction: column;
  align-items: center;
  padding: var(--space-lg) 0 var(--space-xs);
}

[data-header-style="centered"] .header-content-centered {
  display: flex;
}

.centered-meta {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xs);
  /* Even tighter margin */
  font-family: var(--font-body);
  font-size: var(--size-xs);
  text-transform: capitalize;
  /* Title Case */
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

/* Project Credits Section */
.project-credits {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
}

.credits-heading {
  font-family: var(--font-body);
  font-size: var(--size-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-text-muted);
  margin-bottom: 0;
  font-weight: 500;
  white-space: nowrap;
}

.credits-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  justify-content: flex-end;
}

.credits-row {
  display: flex;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: var(--size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.credit-role {
  color: var(--color-text-muted);
}

.credit-role::after {
  content: ":";
}

.credit-name {
  color: var(--color-text);
  font-weight: 500;
}

.project-title-centered {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 8vw, 5rem);
  /* Scalable huge size */
  line-height: 0.95;
  margin: 0 0 var(--space-sm);
  /* Reduced margin */
  text-transform: capitalize;
  /* Title Case */
  letter-spacing: -0.01em;
  max-width: 650px;
  font-weight: 600;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.centered-intro-wrapper {
  max-width: 600px;
  margin: 0 auto;
}

.centered-intro {
  font-family: var(--font-body);
  font-size: var(--size-sm);
  text-transform: capitalize;
  /* Title Case */
  letter-spacing: 0.05em;
  color: var(--color-text);
  margin-top: 0;
  margin-bottom: var(--space-xs);
  /* Very tight */
}

/* Internal Project Headings - Title Case */
.project-body h2,
.project-body h3 {
  font-family: var(--font-display);
  text-transform: capitalize;
  letter-spacing: -0.01em;
  max-width: 650px;
}

/* Consolidated Centered Header - Cleanup complete */

.centered-scope {
  display: flex !important;
  justify-content: center !important;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
  margin-bottom: var(--space-xl);
}

.sidebar-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md) !important;
}

.project-header-left {
  display: flex;
  align-items: center;
}

[data-theme="dark"] {
  --color-bg: #111111;
  --color-bg-secondary: #1a1a1a;
  --color-text: #e6e6e6;
  --color-text-muted: #999999;
  --color-border: rgba(255, 255, 255, 0.1);
  --color-accent: #ffffff;
}

[data-theme="dark"] .project-section {
  border: none;
}

/* Theme-specific visibility utilities */
.theme-dark-only {
  display: none !important;
}

[data-theme='dark'] .theme-dark-only {
  display: block !important;
}

[data-theme='dark'] .theme-light-only {
  display: none !important;
}

@media (max-width: 900px) {
  :root {
    --space-xl: 1.5rem;
    --space-2xl: 2.5rem;
    --section-gap: 1rem;
  }
}

@media (max-width: 900px) {
  :root {
    --space-xl: 1.5rem;
    --space-2xl: 2.5rem;
    --section-gap: 1rem;
  }
}

@media (max-width: 768px) {
  :root {
    --space-xl: 1rem;
    --space-lg: 0.75rem;
    --section-gap: 0.75rem;
    --sidebar-px: 0px;
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--color-bg);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100vw;
}

body {
  font-family: var(--font-body);
  font-size: var(--size-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100vw;
}

body.index-page {
  position: fixed;
  /* Strictly lock body on mobile to prevent overscroll, main-content handles scroll inside */
}

/* Ensure body doesn't actually scroll since .app-view handles it */
.index-page {
  position: fixed;
  inset: 0;
  overflow: hidden;
}



/* Hide default header/footer on homepage */
.index-page .site-header,
.index-page .site-footer {
  display: none;
}

.index-page .main-content {
  padding-top: 0;
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
  position: absolute;
  /* Changed from relative to absolute to fit inside fixed body */
  inset: 0;
}

/* ============================================
   2-COLUMN LAYOUT
   ============================================ */
.portfolio-wrapper {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
  overflow: visible;
}

.portfolio-wrapper.sidebar-hidden {
  grid-template-columns: 0px 1fr;
}

@media (max-width: 900px) {
  .portfolio-wrapper.sidebar-hidden {
    grid-template-columns: 1fr;
  }
}

/* Right-align layout on wide screens: sidebar expands, projects stay fixed width */
@media (min-width: 122rem) {
  .portfolio-wrapper {
    grid-template-columns: 1fr var(--max-project-width);
    margin-right: var(--space-lg);
  }

  .portfolio-wrapper.sidebar-hidden {
    grid-template-columns: 0px 1fr;
    margin-right: 0;
  }

  .sidebar {
    align-items: flex-end;
    text-align: right;
  }

  .sidebar-header,
  .sidebar-body,
  .sidebar-footer {
    width: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  .footer-grid {
    display: grid !important;
    grid-template-columns: repeat(2, auto);
    gap: 3rem;
    width: auto;
  }

  .footer-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
  }

  .footer-nav {
    align-items: flex-end;
  }

  .footer-col-toggle {
    display: flex !important;
    width: auto !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 1rem;
    pointer-events: none;
    justify-content: flex-end;
  }

  .footer-toggle-icon {
    display: none !important;
  }

  .sidebar-logo {
    text-align: right;
  }

  .sidebar-description {
    text-align: right;
  }

  .social-icons {
    justify-content: flex-end;
    width: 100%;
  }

  /* Fix for the Get in Touch button alignment */
  .sidebar-cta-wrapper {
    width: auto;
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
  }

  .sidebar .unicorn-btn {
    width: 14rem !important;
    height: 4.5rem !important;
    margin: 0 !important;
    /* Ensure no margins interfere */
    margin-right: -2rem !important;
    /* Specific wide-screen alignment exception */
  }
}

/* ============================================
   LEFT SIDEBAR
   ============================================ */
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  background: var(--color-bg);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  overflow: hidden;
  border-right: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar.sidebar-hidden {
  transform: translateX(-100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sidebar-header {
  margin-bottom: 0rem;
}

.sidebar-logo {
  font-size: 0.8125rem;
  font-weight: 400;
  text-transform: lowercase;
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.sidebar-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 24rem;
  margin-top: 2rem;
  /* More space like in the image */
}

.sidebar-description {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.0rem);
  line-height: 1.0;
  color: var(--color-text);
  margin: 0;
  letter-spacing: -0.01em;
  font-weight: 500;
}

.sidebar-cta-wrapper {
  margin-top: auto;
  /* Centralized animation for both button and text */
  opacity: 0;
  animation: fadeInButton 0.5s ease-out 0.8s forwards;
  will-change: transform, opacity;
}

/* Scaled Unicorn button for sidebar */
.sidebar .unicorn-btn {
  width: 125%;
  height: 5rem;
  margin-left: -1.4rem;
  display: block;
  position: relative;
  /* Mask any square flash during Unicorn canvas initialization */
  border-radius: 9999px;
  overflow: hidden;
}

.sidebar .unicorn-btn canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  /* Invert to make button dark on light mode (default is white lines) */
  filter: invert(1);
}

@keyframes fadeInButton {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

[data-theme="dark"] .sidebar .unicorn-btn canvas {
  /* Keep dark/black on dark mode - no inversion needed */
  filter: none !important;
}

/* Text styling for both modes */
.sidebar .unicorn-btn .btn-text {
  position: absolute;
  inset: 0;
  font-size: 0.975rem;
  font-weight: 600;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  color: #ffffff;
  /* White text on dark button in light mode */
}

[data-theme="dark"] .sidebar .unicorn-btn .btn-text {
  color: #000000;
  /* Black text on dark mode */
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.footer-col-title {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1rem;
}

/* Mobile Accordion Toggle Button */
.footer-col-toggle {
  display: none;
  /* Hidden on desktop */
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.75rem 0;
  cursor: pointer;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border, rgba(128, 128, 128, 0.2));
}

.footer-col-toggle .footer-col-title {
  margin-bottom: 0;
}

.footer-toggle-icon {
  font-size: 1rem;
  color: var(--color-text-muted);
  transition: transform var(--transition-fast);
}

.footer-col-toggle[aria-expanded="true"] .footer-toggle-icon {
  transform: rotate(45deg);
}

/* Collapsible nav on mobile */
.footer-nav-collapsible {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-link-item {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  opacity: 0.5;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.footer-link-item:hover,
.footer-link-item.active,
.project-link-item.active {
  color: var(--color-text);
  opacity: 1;
}

.sidebar-email {
  margin-top: 0.5rem;
  display: block;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  opacity: 0.5;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.sidebar-email:hover {
  color: var(--color-text);
  opacity: 1;
}

.avatar {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  object-fit: cover;
  margin-bottom: var(--space-md);
}

.social-icons {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-sm);
  margin-top: 11px;
  margin-bottom: 11px;
}

.social-icons a {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-bg-secondary);
  font-size: var(--size-sm);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.social-icons a:hover {
  background: var(--color-text);
  color: var(--color-bg);
}

.author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.author-name {
  font-size: var(--size-base);
  font-weight: 500;
}

.author-role {
  font-size: var(--size-sm);
  color: var(--color-text-muted);
}

/* ============================================
   RIGHT COLUMN - PROJECTS
   ============================================ */
.projects-column {
  padding: var(--projects-column-padding-top, 2rem) var(--space-lg) var(--space-lg);
  background: transparent;
  /* Homepage project card spacing knobs */
  --project-carousel-to-info-gap: var(--space-sm);
  --project-info-padding-top: 0.125rem;
  /* 39px at 16px root */
}

.projects-heading {
  font-family: var(--font-display);
  font-size: var(--size-xl);
  font-weight: 400;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

.project-section {
  margin-bottom: var(--section-gap);
  background: var(--color-bg-secondary);
  border-radius: var(--radius-l);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--color-border);
  max-width: var(--max-project-width);
  width: 100%;
}

.project-section .project-info {
  padding: var(--space-md) var(--space-lg) 2.625rem;
}

.project-section .project-carousel-wrapper {
  margin-bottom: 0px;
  border-radius: var(--radius-m);
}

.project-carousel-wrapper {
  display: block;
  position: relative;
  /* Ultimate Fix: Use margins to inset the component instead of padding.
     This ensures every slide snaps to the same '0' coordinate. */
  margin: 0.5rem 0.5rem 0 0.5rem;
  width: calc(100% - 1rem);
  border-radius: var(--radius-m);
  overflow: hidden;
  --slider-cursor: ew-resize;
  cursor: var(--slider-cursor);
  --carousel-slide-gap: 0.5rem;
}

@media (max-width: 48rem) {
  .project-carousel-wrapper {
    margin: 0.5rem 0.5rem 0 0.5rem;
    width: calc(100% - 1rem);
  }
}

/* Navigation Zones - visual only, cursor set via JS on wrapper */
.carousel-nav-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  z-index: 5;
  pointer-events: none;
}

.carousel-nav-zone--left {
  left: 0;
}

.carousel-nav-zone--right {
  right: 0;
}

.carousel-scroll-hint {
  position: absolute;
  right: 0.875rem;
  bottom: 0.875rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-m);
  font-size: var(--size-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.35);
  background: color-mix(in srgb, var(--color-bg) 60%, transparent);
  border: 1px solid var(--color-border);
  opacity: 0.55;
  transform: translateY(0.125rem);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  pointer-events: none;
}

.project-carousel-wrapper:hover .carousel-scroll-hint,
.project-carousel-wrapper:focus-within .carousel-scroll-hint {
  opacity: 0.9;
  transform: translateY(0);
}

/* Hover effect removed */
/* .project-carousel-wrapper:hover {
  transform: scale(1.01);
} */

.project-carousel-progress {
  position: relative;
  height: 0.1875rem;
  background: rgba(0, 0, 0, 0.1);
  width: 50%;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--radius-m);
}

.project-carousel-progress span {
  display: block;
  height: 100%;
  background: #9d9d9d;
  /* Black */
  border-radius: var(--radius-m);
  transform-origin: left center;
  /* transform: scaleX(0); */
  /* transition: transform var(--progress-transition, 0.2s) ease; */
}

/* Embla Carousel */
.embla {
  overflow: hidden;
}

.embla__viewport {
  overflow: hidden;
  width: 100%;
  border-radius: var(--radius-m);
  /* Fix for border-radius overflow clipping */
  isolation: isolate;
}

.embla__container {
  display: flex;
  touch-action: pan-y pinch-zoom;
  gap: var(--carousel-slide-gap, 1.25rem);
  will-change: transform;
}

.embla__slide {
  flex: 0 0 100%;
  min-width: 0;
  border-radius: var(--radius-m);
  overflow: hidden;
  aspect-ratio: var(--carousel-aspect-ratio, 16 / 9);
  background: var(--color-bg-secondary);
  position: relative;
  flex-shrink: 0;
}

.project-slide-item {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-m);
}

/* No more next slide peek, always single slide in focus */
@media (min-width: 87.5rem) {
  .embla__slide {
    flex: 0 0 100%;
    max-width: var(--max-project-width);
  }
}

.project-slide-item img,
.project-slide-item .unicorn-scene canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  object-position: var(--carousel-object-position, center);
  /* Parallax: translateY shifts image within container, scale provides overflow room */
  /* Parallax removed as requested */
  transform: none !important;
  -webkit-user-drag: none;
  z-index: 0;
  will-change: transform;
}

/* Canvas fade-in effect */
.embla__slide .unicorn-scene canvas {
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Instant snap for background-preloaded scenes */
.unicorn-scene[data-background-lazy-us="true"] canvas {
  opacity: 1 !important;
  transition: none !important;
}

.embla__slide .unicorn-scene.loaded canvas {
  opacity: 1;
  user-select: none;
  border-radius: inherit;
  /* Ensure clipping on images/canvas */
  mask-image: radial-gradient(white, black);
  -webkit-mask-image: -webkit-radial-gradient(white, black);
}

/* ============================================
   SECTION HEADER COMPONENT
   Reusable title/subtitle pattern with no bottom margins
   ============================================ */
.section-header {
  display: flex;
  flex-direction: column;
  gap: var(--section-header-gap, var(--space-xs));
}

.section-header .section-title,
.section-header .section-subtitle {
  margin: 0;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 500;
  color: var(--color-text);
  margin: 0;
}

.section-title--lg {
  font-size: var(--size-xl);
}

.section-title--xl {
  font-size: var(--size-2xl);
}

.section-title--2xl {
  font-size: var(--size-3xl);
}

.section-title--4xl {
  font-size: var(--size-4xl);
  font-weight: 400;
  line-height: 1.1;
}

.section-subtitle {
  font-size: var(--size-sm);
  color: var(--color-text-muted);
  margin: 0;
}

.section-subtitle--lg {
  font-size: var(--size-lg);
}

/* ============================================
   INFO SECTION COMPONENT
   Reusable heading/text pattern for info blocks
   ============================================ */
.info-section {
  display: flex;
  flex-direction: column;
  gap: var(--info-section-gap, var(--space-xs));
}

.info-section .info-heading,
.info-section .info-text {
  margin: 0;
}

.info-heading {
  font-size: var(--size-sm);
  font-weight: 600;
  color: var(--color-text);
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
}

.info-text {
  font-size: var(--size-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Project Info */
.project-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: var(--space-xl);
  row-gap: var(--space-xs);
  margin-top: 0;
  padding: var(--space-lg) var(--space-lg) 2.625rem;
  padding-top: var(--project-info-padding-top, var(--space-lg));
  background: var(--color-bg-secondary);
  border-radius: var(--radius-s);
  max-width: var(--max-project-width);
  /* Match slider max-width */
}

.project-info-header {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
}

/* Container for headline + description */
.project-text-container {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  /* 50% reduced gap between title and subtitle */
}

.project-title-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: auto;
  margin-bottom: 0;
}

.project-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.project-pill-button {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.75rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  white-space: nowrap;
}

.project-title-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: opacity 0.2s ease;
}

.project-title-link:hover {
  opacity: 0.7;
}

.world-icon {
  width: 1.1rem;
  height: 1.1rem;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.project-title-link:hover .world-icon {
  opacity: 1;
}

.project-pill-button svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.3s ease;
}

.project-pill-button:hover {
  background: var(--color-text);
  color: var(--color-bg);
  border-color: var(--color-text);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.project-pill-button:hover svg {
  transform: translate(1px, -1px);
}



.project-info-left {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.project-info-right {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* Simplified project section layout */
.project-description {
  grid-column: 1 / -1;
  margin-top: 0.25rem;
  display: none;
  /* Hidden for now */
}

.project-description .project-info-text {
  max-width: 48rem;
  line-height: 1.6;
}

.project-meta-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}

.project-scope-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.scope-tag {
  font-size: var(--size-xs);
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
}

.scope-separator {
  color: var(--color-text-muted);
  opacity: 0.5;
  margin: 0 0.25rem;
}

.project-meta-row .project-year {
  font-size: var(--size-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  margin-left: auto;
}

/* Legacy support - maps to component classes */
.project-title {
  font-family: var(--font-display);
  font-size: 1.5625rem;
  font-weight: 500;
  line-height: 1.5125rem;
  color: var(--color-text);
  margin: 0;
}

.project-info .project-title {
  padding-bottom: 4px;
  line-height: 1.5125rem;
}

.project-info-text {
  font-size: 1.15rem;
  line-height: 1.35rem;
  color: var(--color-text-muted);
  margin: 0;
  padding-bottom: 6px;
  max-width: 40rem;
}

.project-subtitle {
  font-size: 1.15rem;
  line-height: 1.35rem;
  color: var(--color-text-muted);
  margin: 0;
  padding-bottom: 12px;
  /* Reduced by 50% */
}

.project-info-section {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

/* ============================================
   TABS & PLAYGROUND
   ============================================ */
.floating-controls {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  pointer-events: none;
  /* Let events pass through the container */
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.floating-controls.controls-hidden {
  transform: translate(-50%, 150%);
  opacity: 0;
}

.content-tabs {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  height: 3rem;
  padding: 0 0.3rem;
  pointer-events: auto;
  /* Buttons remain interactive */
  display: flex;
  align-items: center;
  gap: 0.25rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .content-tabs {
  background: rgba(17, 17, 17, 0.8);
}

.tab-indicator {
  position: absolute;
  top: 0.3rem;
  bottom: 0.3rem;
  left: 0;
  background: var(--color-text);
  border-radius: var(--radius-full);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 0;
  will-change: transform, width;
}

.tab-button {
  height: 2.4rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1;
  position: relative;
  touch-action: manipulation;
}

.tab-button:hover {
  color: var(--color-text);
}

.tab-button.active {
  color: var(--color-bg);
}

/* Theme Toggle Button (Separate) */
.theme-toggle {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto !important;
  /* Theme toggle remains interactive */
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  position: relative;
  overflow: hidden;
  z-index: 10;
  /* Ensure it stays above siblings if any overlap */
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

[data-theme="dark"] .theme-toggle {
  background: rgba(26, 26, 26, 0.7);
}

.theme-toggle:hover {
  transform: scale(1.05);
  background: var(--color-bg-secondary);
}

.theme-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -0.75rem;
  /* Half of height */
  margin-left: -0.75rem;
  /* Half of width */
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.3s;
}

.theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

/* Dark mode state for button icons */
[data-theme="dark"] .theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0) scale(1);
}

[data-theme="dark"] .theme-toggle .sun-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.projects-column {
  overflow-x: hidden;
}

.tab-content {
  visibility: hidden;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  transition: transform 1s cubic-bezier(0.45, 0, 0.55, 1);
  will-change: transform;
  z-index: 1;
}

/* Initial/Exit positions */
.tab-content[data-tab="home"] {
  transform: translateX(-100%);
}

.tab-content[data-tab="playground"] {
  transform: translateX(100%);
}

.tab-content.active {
  visibility: visible;
  pointer-events: auto;
  position: relative;
  height: auto;
  transform: translateX(0) !important;
  z-index: 2;
}

.tab-content.exiting {
  visibility: visible;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

/* Playground Bento Grid */
.playground-header {
  padding: var(--section-gap) var(--space-xl) var(--space-xl);
  max-width: var(--max-project-width);
  margin: 0 auto;
  text-align: center;
}

.playground-title {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  letter-spacing: -0.02em;
}

.playground-description {
  font-size: var(--size-base);
  color: var(--color-text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.playground-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  grid-auto-rows: 350px;
  grid-auto-flow: dense;
  gap: var(--space-md);
  padding: 0 var(--space-xl) var(--section-gap);
  max-width: var(--max-project-width);
  margin: 0 auto;
  transition: max-width 0.6s ease;
}

.portfolio-wrapper.sidebar-hidden .playground-grid {
  max-width: 1400px;
  /* Expand a bit more when sidebar is gone */
}

.portfolio-wrapper.sidebar-hidden .playground-header {
  max-width: 1400px;
}

@media (max-width: 768px) {
  /* Already handled by 900px media query or specialized overrides */
}

.playground-item {
  position: relative;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--color-bg-secondary);
  cursor: pointer;
}

/* Irregular sizes - only for desktop */
@media (min-width: 769px) {
  .playground-item:nth-child(3n) {
    grid-column: span 2;
  }

  .playground-item:nth-child(5n) {
    grid-row: span 2;
  }

  .playground-item:nth-child(7n) {
    grid-column: span 2;
    grid-row: span 2;
  }
}

.playground-item video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 1;
}

.playground-item video.loaded {
  opacity: 1;
}

.playground-item .video-placeholder {
  position: absolute;
  inset: 0;
  background: var(--color-bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.playground-item:hover video {
  /* Playback handled via JS */
  cursor: pointer;
}

/* Experience section container */
#experience {
  background: color-mix(in srgb, var(--color-bg-secondary), transparent 50%);
  border-radius: var(--radius-xl);
  padding: 3.75rem 2.5rem;
  max-width: var(--max-project-width);
  margin-bottom: var(--section-gap);
}

#experience.content-section {
  padding: 3.75rem 2.5rem;
  /* Override content-section horizontal padding */
}

.section-intro {
  font-size: var(--size-lg);
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: var(--space-xl);
  max-width: 1000px;
}

/* Experience */
.experience-intro {
  font-size: var(--size-lg);
  line-height: 1.5;
  color: var(--color-text);
  margin-bottom: var(--space-2xl);
  max-width: 1000px;
  margin-top: var(--space-sm);
  opacity: 0.8;
}

.experience-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2xl);
  margin-bottom: 3.875rem;
}

.experience-block h4 {
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

/* Resume Lists (Speaking/Events) */
.resume-lists-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  border-top: 1px solid var(--color-border);
  padding-top: 0px;
  padding-bottom: 0px;
  max-width: none;
}

@media (min-width: 1200px) {
  .resume-lists-grid {
    grid-template-columns: 1fr;
  }
}

/* Match the experience-timeline width */

.resume-list-column {
  padding-top: 32px;
}

.resume-section-heading {
  font-family: var(--font-display);
  font-size: var(--size-xl);
  /* Match Connect section heading size */
  font-weight: 500;
  color: var(--color-text);
  margin: var(--space-lg) 0;
}

.resume-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}

.resume-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  font-size: var(--size-sm);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border);
  padding: 10px 10px 10px 0px;
}

.resume-list li:last-child {
  border-bottom: none;
}

.resume-item-title {
  color: var(--color-text);
  font-weight: 500;
}

.resume-item-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.resume-item-description {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  opacity: 1;
  /* Was getting color from muted parent */
  margin: 0;
  line-height: 1.4;
}

/* Floating Resume Hover Preview */
.resume-hover-preview {
  position: fixed;
  top: 0;
  left: 0;
  width: 320px;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.85);
  transition: opacity 0.3s cubic-bezier(0.23, 1, 0.32, 1),
    transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
    visibility 0.3s;
  background: #000;
  /* Dark premium background as requested */
  color: #fff;
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  will-change: transform, opacity;
}

.resume-hover-preview.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.resume-hover-preview .preview-content {
  display: flex;
  flex-direction: column;
}

.resume-hover-preview .preview-media {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #1a1a1a;
}

.resume-hover-preview .preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.resume-hover-preview .preview-image.loaded {
  opacity: 1;
}

.resume-hover-preview .preview-text {
  padding: 1.5rem;
}

.resume-hover-preview .preview-header {
  margin-bottom: 0.75rem;
}

.resume-hover-preview .preview-year {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
  margin-bottom: 0.25rem;
}

.resume-hover-preview .preview-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: #fff;
  margin: 0;
  text-transform: uppercase;
}

.resume-hover-preview .preview-description {
  font-size: 0.875rem;
  line-height: 1.5;
  color: #ccc;
  margin: 0;
}

/* Cursor style for interactive list items */
.resume-list-item {
  cursor: pointer;
  position: relative;
  transition: background-color 0.2s ease;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .resume-hover-preview {
    display: none;
    /* We can handle mobile differently or show static */
  }
}

/* Clients */
.clients-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  list-style: none;
  padding: 0;
  margin-top: var(--space-xl);
}

.client-item {
  color: var(--color-text);
  font-size: var(--size-2xl);
  /* Large, display-like font for logos effect */
  opacity: 0.5;
  transition: opacity var(--transition-base);
  cursor: default;
}

.client-item:hover {
  opacity: 1;
}

/* Connect */
#connect {
  background: #000;
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 3.75rem;
  margin: 0;
  margin-bottom: var(--section-gap);
  border: none;
  width: 100%;
  max-width: var(--max-project-width);
}

#connect .project-title {
  color: #666;
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2.5rem;
  font-weight: 500;
}

.connect-wrapper {
  overflow: visible;
  max-width: 100%;
}

.connect-content {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2.5rem;
  align-items: start;
}

.connect-main {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.connect-side {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

#connect .section-intro {
  font-family: var(--font-display);
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 500;
  color: #fff;
  margin-bottom: 1.25rem;
  max-width: 40rem;
}

/* Connect button using global unicorn-btn styles */
#connect .unicorn-btn {
  margin-left: -2.125rem;
  /* Align with text by compensating for button padding in JSON */
}

#connect .btn-text {
  color: #000 !important;
}

#connect .connect-secondary {
  border-top: none;
  padding-top: 0;
}

#connect .connect-secondary .project-info-text {
  color: #888;
  font-size: 1rem;
  margin-bottom: 0.75rem;
  max-width: 30rem;
}

#connect .connect-link {
  color: #fff;
  font-size: 1rem;
  text-decoration: underline;
  text-underline-offset: 0.25rem;
  display: block;
  margin-bottom: 0px;
}

/* Connect Footer Bottom */
.connect-footer-bottom {
  margin-top: 5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2.5rem;
}

.connect-footer-email {
  font-weight: 500;
  font-size: 1.5rem;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s;
}

.connect-footer-email:hover {
  opacity: 0.8;
}

.connect-footer-socials {
  display: flex;
  gap: 1.5rem;
}

.connect-footer-socials a {
  color: #fff;
  font-size: 0.875rem;
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.connect-footer-socials a:hover {
  opacity: 1;
}

@media (max-width: 87.5rem) {
  .connect-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  #connect {
    padding: 2.5rem;
  }
}

@media (max-width: 768px) {
  #connect {
    padding: 2.5rem 1.5rem;
    border-radius: var(--radius-l);
  }

  #connect .section-intro {
    font-size: 1.5rem;
  }

  .connect-footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
    margin-top: 3.75rem;
  }
}

/* Restore global primary-btn and unicorn-btn styles */
.primary-btn {
  display: inline-block;
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-sm) var(--space-xl);
  border-radius: var(--radius-full);
  font-weight: 500;
  text-decoration: none;
  width: fit-content;
  transition: opacity var(--transition-base);
}

.primary-btn:hover {
  opacity: 0.9;
}

/* Unicorn Studio Button - animation serves as the button background */
.unicorn-btn {
  display: block;
  position: relative;
  width: 25rem;
  /* Match JSON artboard width */
  height: 6.25rem;
  /* Match JSON artboard height */
  margin: 0;
  margin-left: -2.125rem;
  /* Align left */
  cursor: pointer;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  overflow: visible;
}

.unicorn-btn:hover {
  transform: scale(1);
  opacity: 1;
}

.unicorn-btn canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 25rem !important;
  height: 6.25rem !important;
  pointer-events: none !important;
  /* Ensure events reach the parent .unicorn-btn */
}

.unicorn-btn .btn-text {
  position: absolute;
  /* Position text to match the button shape in JSON: 8% left, 17% top, 336x66 */
  left: 2rem;
  /* 8% of 400 */
  top: 1.0625rem;
  /* 17% of 100 */
  width: 21rem;
  height: 4.125rem;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  color: var(--color-bg);
  pointer-events: none !important;
  /* Let clicks pass to the button container */
  text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {

  .experience-grid,
  .resume-lists-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
}


.project-info-heading {
  padding-bottom: 0.5rem;
  line-height: 1rem;
  height: fit-content;
  font-weight: 600;
  color: var(--color-text-muted);
}

.project-info-text {
  font-size: var(--size-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}

.project-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0;
  line-height: 1.6;
  max-height: calc(1.6em * 2.2);
  overflow: hidden;
}

.project-info-list li {
  font-size: var(--size-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  white-space: nowrap;
}

.project-info-list li:not(:last-child)::after {
  content: ',';
  margin-right: 0.25rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .portfolio-wrapper {
    grid-template-columns: 1fr;
    margin: 0;
    width: 100%;
    /* Ensure no independent scroll */
    overflow: visible;
    height: auto;
    display: flex;
    flex-direction: column;
  }

  .projects-column {
    padding-left: 0;
    padding-right: 0;
    --project-carousel-to-info-gap: 0px;
    /* Ensure no independent scroll */
    overflow: visible;
    height: auto;
  }

  .project-section {
    border-radius: var(--radius-l);
    border: none;
    box-shadow: none;
    margin-bottom: var(--section-gap);
    width: 100%;
  }

  .project-carousel-wrapper {
    padding: 0;
    margin: 0.5rem 0.5rem 0 0.5rem;
    width: calc(100% - 1rem);
    border-radius: var(--radius-m);
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }

  .embla__viewport {
    border-radius: var(--radius-m);
    mask-image: none !important;
    -webkit-mask-image: none !important;
  }

  .project-section {
    border-radius: var(--radius-l) !important;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .embla__slide,
  .project-info,
  .image-container,
  .image-skeleton,
  .unicorn-scene,
  .unicorn-scene canvas,
  .unicorn-scene-skeleton,
  .project-slide-item,
  .project-carousel-item {
    border-radius: 0 !important;
    width: 100%;
    max-width: 100%;
  }

  /* Keep the scroll pill rounded */
  .carousel-scroll-hint {
    border-radius: var(--radius-xl) !important;
  }

  .project-info {
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .project-info .project-title,
  .project-subtitle,
  .project-description p {
    padding-bottom: 0;
    margin-bottom: 0;
  }

  .project-meta-row {
    margin-top: 0.25rem;
    padding-top: 0.75rem;
  }

  .project-meta-row .project-year {
    display: none;
  }

  /* Disable heavy effects for better mobile performance */
  .content-tabs,
  .theme-toggle {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--color-bg-secondary);
    pointer-events: auto !important;
    /* Ensure interactive on mobile too */
  }

  .embla__slide {
    will-change: transform;
  }

  /* Playground Mobile Scaling */
  .playground-header {
    padding: 0.75rem 8px 0.5rem;
  }

  .playground-title {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
  }

  .playground-description {
    font-size: 0.875rem;
  }

  .playground-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    padding: 0 8px var(--section-gap);
  }

  .playground-item {
    aspect-ratio: 1 / 1;
    border-radius: var(--radius-m);
  }

  .sidebar {
    position: relative;
    height: auto;
    min-height: auto;
    top: unset;
    border-right: none;
    border-bottom: none;
    padding: 0;
    padding-top: 3.5rem;
    padding-bottom: 0rem;
    display: flex;
    flex-direction: column;
    width: 100%;
    --sidebar-px: 0px;
    align-items: center;
    overflow: visible;
    /* Not sticky on mobile - scrolls with page */
    /* Ensure no max-height or scroll */
    max-height: none;
  }

  .sidebar-hero,
  .sidebar-body {
    padding-left: var(--space-md);
    padding-right: var(--space-md);
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .sidebar-description {
    text-align: center;
    max-width: 20rem;
    /* Compact for mobile centering */
  }

  .sidebar-footer {
    width: 100%;
    padding-top: 1rem;
    text-align: left;
  }

  .sidebar.sidebar-hidden {
    height: 0;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    pointer-events: none;
  }

  /* Centered logo */
  .sidebar-logo {
    text-align: center;
    display: block;
    width: 100%;
  }

  /* Footer Accordion Styles */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .footer-col-toggle {
    display: flex;
    padding: 0.75rem var(--space-md);
    border-top: 1px solid var(--color-border, rgba(128, 128, 128, 0.2));
    width: 100%;
    background: transparent;
    border-left: none;
    border-right: none;
    border-bottom: none;
    cursor: pointer;
    align-items: center;
    justify-content: space-between;
  }

  .footer-col>.footer-col-title {
    display: none;
  }

  .footer-nav-collapsible {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    padding: 0 var(--space-md);
  }

  .footer-nav-collapsible.expanded {
    max-height: 500px;
    opacity: 1;
    padding-bottom: 1rem;
  }

  /* Substantial Button on Mobile */
  .sidebar-cta-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 1rem 0;
    opacity: 1 !important;
    /* Force visibility */
    transform: none !important;
    animation: none !important;
  }

  .sidebar .unicorn-btn {
    width: 110%;
    height: 5rem;
    margin: 0;
    position: relative;
    border-radius: 9999px;
    z-index: 10;
  }

  .sidebar-nav,
  .social-icons {
    text-align: left;
    padding-left: 0;
    padding-right: 0;
    justify-content: flex-start;
  }

  .project-links-toggle {
    justify-content: space-between;
    padding-left: 0;
    padding-right: 0;
  }

  .project-link-item {
    text-align: left;
  }

  .sidebar-title {
    font-size: 1.5rem;
    max-width: 100%;
    margin-left: 0;
  }

  .project-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
  }

  .project-info-header {
    order: 0;
    /* Title stays at top */
    flex-direction: row;
    align-items: flex-start;
    /* Align arrow to top of title+description */
  }

  /* Arrow-only button on mobile */
  .project-pill-button {
    padding: 0.5rem;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .project-pill-button span,
  .world-icon {
    display: none;
  }

  .project-pill-button svg {
    width: 1.5rem;
    height: 1.5rem;
  }

  /* 20% smaller title and description on mobile */
  .project-title {
    font-size: 1.45rem;
    /* 1.5625rem * 0.8 */
    line-height: 1.2;
  }

  .project-subtitle {
    font-size: 1rem;
    /* 1.25rem * 0.8 */
  }

  .project-info-left,
  .project-info-right {
    display: contents;
  }

  .project-info-left .project-info-section:first-child {
    order: 1;
    /* Problem */
  }

  .project-info-right .project-info-section:first-child {
    order: 2;
    /* Solution */
  }

  .project-info-left .project-info-section:last-child {
    order: 3;
    /* Scope */
  }

  .project-info-right .project-info-section:last-child {
    order: 4;
    /* When */
  }
}

/* ============================================
   PROJECT DETAIL PAGE (keep existing styles)
   ============================================ */
@media (min-width: 1024px) {
  .project-page {
    padding: var(--project-page-padding-y, var(--space-2xl)) 40px;
    max-width: 100%;
  }

  body.project-page {
    /* Full width for detail pages */
    --max-project-width: 100%;
  }
}

body.project-page {
  /* Scroll fix: Base body is now position: relative */
  overflow-y: auto;
  height: auto;
  width: 100%;
}

.project-page {
  margin: 0 auto;
}

body.project-page {
  padding-top: 0;
  padding-bottom: 0;
  --project-page-padding-y: var(--space-xl);
  --project-page-header-gap: var(--space-lg);
  --project-page-block-gap: var(--space-lg);
  --project-page-content-gap: var(--space-lg);
}

.project-header {
  margin-bottom: var(--project-page-header-gap, var(--space-xl));
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.project-meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-sm);
}


.project-meta span {
  font-size: var(--size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
}

.project-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--size-xs);
}

.project-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color var(--transition-fast);
}

.project-back:hover {
  color: var(--color-text);
}

.project-breadcrumb span {
  text-transform: none;
  letter-spacing: 0;
}

.breadcrumb-separator {
  opacity: 0.6;
}

.breadcrumb-current {
  color: var(--color-text);
}

.project-meta-details {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
}

.project-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.project-category-top {
  font-size: var(--size-xs);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.mobile-only {
  display: none !important;
}

@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  .project-header-top {
    margin-bottom: var(--space-lg);
  }
}

.project-page .project-title {
  font-family: var(--font-display);
  font-size: var(--size-4xl);
  font-weight: 600;
  line-height: 1.1;
  margin: 0;
}

.project-header .section-header {
  --section-header-gap: var(--space-sm);
}

.project-intro {
  font-size: var(--size-lg);
  color: var(--color-text-muted);
  max-width: 43.75rem;
}

/* Carousel for detail page */
.project-page .project-carousel {
  margin: var(--project-page-block-gap, var(--space-xl)) 0;
}

.project-page .carousel-item {
  flex: 0 0 85%;
  scroll-snap-align: center;
  border-radius: var(--radius-m);
  overflow: hidden;
  height: var(--project-page-carousel-height, 60vh);
  min-height: 25rem;
  background: var(--color-bg-secondary);
}

.project-page .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: var(--carousel-object-fit, cover);
  object-position: var(--carousel-object-position, center);
}

.project-content {
  display: grid;
  grid-template-columns: 17.5rem 1fr;
  gap: var(--project-page-content-gap, var(--space-xl));
  margin-top: var(--project-page-block-gap, var(--space-xl));
  max-width: 60rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.project-details {
  position: sticky;
  top: var(--space-lg);
  align-self: start;
}

.project-details .detail {
  margin-bottom: var(--space-lg);
}

.project-details h4 {
  font-size: var(--size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-muted);
  margin: 0;
}

.project-details .detail {
  --info-section-gap: var(--space-xs);
}

.project-details p {
  font-size: var(--size-base);
}

.project-link {
  color: var(--color-accent);
  font-weight: 500;
}

.project-body {
  font-size: var(--size-lg);
  text-align: center;
  line-height: 1.8;
}

.project-body p {
  margin-bottom: var(--space-lg);
}

.project-body h2 {
  font-size: var(--size-2xl);
  font-weight: 500;
  margin: var(--space-2xl) 0 var(--space-md);
}

.project-body img {
  border-radius: var(--radius-s);
  margin: var(--space-lg) 0;
}



/* ============================================
   GENERIC PAGE
   ============================================ */
.page {
  padding: var(--space-2xl) var(--space-lg);
  max-width: 50rem;
  margin: 0 auto;
}

.page-header {
  margin-bottom: var(--space-xl);
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--size-4xl);
  font-weight: 400;
  margin: 0;
}

.page-subtitle {
  font-size: var(--size-lg);
  color: var(--color-text-muted);
  margin: 0;
}

.page-header .section-header {
  --section-header-gap: var(--space-md);
}

.page-content {
  font-size: var(--size-lg);
  line-height: 1.8;
}

.page-content p {
  margin-bottom: var(--space-lg);
}

/* ============================================
   HEADER & FOOTER (for non-homepage)
   ============================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-md) var(--space-lg);
  background: var(--color-bg);
}

.nav {
  max-width: var(--max-project-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: var(--size-lg);
  font-weight: 500;
}

.nav-links {
  display: flex;
  gap: 0px;
}

.nav-links a {
  font-size: var(--size-sm);
  color: var(--color-text-muted);
}

.nav-links a:hover {
  color: var(--color-text);
}

.main-content {
  padding-top: 0;
  min-height: 100vh;
}

.site-footer {
  padding: var(--space-2xl) var(--space-lg);
  border-top: 1px solid var(--color-border);
  text-align: center;
}

.footer-content {
  max-width: var(--max-project-width);
  margin: 0 auto;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

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

.social-links {
  display: flex;
  gap: var(--space-lg);
}

.social-links a {
  font-size: var(--size-sm);
  color: var(--color-text-muted);
  text-decoration: none;
}

.social-links a:hover {
  color: var(--color-text);
}

/* Hide footer-cta section */
.footer-cta {
  display: none;
}

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

  .project-content {
    grid-template-columns: 1fr;
  }

  .project-details {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: var(--space-lg);
  }
}

/* Timeline Experience */
.experience-timeline {
  position: relative;
  border-left: 1px solid var(--color-border);
  margin-left: 0.5rem;
  /* Offset for border */
  padding-left: 2rem;
  /* Use margin (not padding) to separate from Events - margin doesn't extend the border */
  margin-bottom: var(--space-xl);
  max-width: none;
}

.timeline-item {
  position: relative;
  padding-bottom: 3rem;
}

.timeline-item:last-child {
  /* No bottom padding - line ends at the Now marker */
  padding-bottom: 0;
}

.timeline-marker {
  position: absolute;
  left: -2.3125rem;
  /* 32px padding + 4px for half marker width + 1/2px border adjust */
  top: 0.375rem;
  width: 0.5625rem;
  height: 0.5625rem;
  border-radius: var(--radius-full);
  background: var(--color-text);
  box-shadow: 0 0 0 0.5rem var(--color-bg);
  /* clear space around marker */
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.timeline-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.timeline-milestone {
  font-size: var(--size-xs);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.timeline-title {
  font-family: var(--font-display);
  font-size: var(--size-lg);
  font-weight: 500;
  color: var(--color-text);
  margin: 0;
}

.timeline-text {
  font-size: var(--size-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Unicorn Studio Scenes in Carousel */
.embla__slide .unicorn-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}

/* ============================================
   APP VIEWPORT & SLIDER ARCHITECTURE
   ============================================ */
.index-page {
  overflow: hidden;
  height: 100dvh;
  width: 100vw;
  /* Main scrollbar handled by views on index page */
}

#app-viewport {
  display: flex;
  width: 200vw;
  height: 100dvh;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
  touch-action: pan-y;
  /* Prevent horizontal swipe */
}

.app-view {
  width: 100vw;
  height: 100dvh;
  overflow-y: scroll;
  /* Force explicit scroll behavior for Safari */
  overflow-x: hidden;
  position: relative;
  /* Smooth scrolling */
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}


/* Home View Layout - Uses existing classes but confined */
.portfolio-wrapper {
  /* It's now just a regular grid inside the scrollable view */
  min-height: auto;
  /* Let content dictate height */
}

/* Playground View specific */
.playground-view-content {
  max-width: 100%;
  width: 100%;
}

.unicorn-scene-skeleton {
  position: absolute;
  inset: 0;
  background-color: var(--color-bg-secondary);
  transition: opacity 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.unicorn-scene.loaded .unicorn-scene-skeleton,
.image-container.loaded .image-placeholder,
.image-container:has(.unicorn-scene.loaded) .image-placeholder {
  opacity: 0;
  pointer-events: none;
  animation: none !important;
  /* Stop shimmer when loaded */
}

/* Image container & placeholder for carousel and related projects */
.image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--color-bg-secondary);
  overflow: hidden;
  border-radius: var(--radius-s);
}

.image-container img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
  z-index: 1;
}


.image-container.loaded img {
  opacity: 1;
}

.image-placeholder {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(20px);
  transform: scale(1.1);
  transition: opacity 0.4s ease;
  z-index: 2;
}

.image-skeleton {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
      rgba(255, 255, 255, 0.03) 0%,
      rgba(255, 255, 255, 0.08) 50%,
      rgba(255, 255, 255, 0.03) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  z-index: 0;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

/* Project Subpage Stacked Images & Gallery */
.project-image-stack,
.project-gallery {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  margin: var(--space-xl) 0;
  width: 100%;
  max-width: none;
}

.project-image-stack .image-container,
.project-gallery .image-container {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-l);
  overflow: hidden;
  position: relative;
  width: 100%;
}

.project-image-stack .image-container img,
.project-gallery .image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Clickable Carousel Links */
.project-slide-link {
  display: block;
  width: 100%;
  height: 100%;
  cursor: var(--slider-cursor, pointer);
  transition: transform 0.4s ease, filter 0.4s ease;
  overflow: hidden;
  border-radius: var(--radius-s);
}

.project-slide-link:hover {
  transform: scale(1.02);
  filter: brightness(1.05);
}

/* Section Entrance Animations */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}


/* Refined Project Subpage Header & Details */
.project-details--top {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  padding-bottom: 0;
  border-bottom: none;
}

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



.project-details--top .detail h4 {
  font-family: var(--font-display);
  font-size: var(--size-2xl);
  font-weight: 500;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
  text-transform: none;
  letter-spacing: normal;
}

.project-details--top .detail p {
  font-size: var(--size-md);
  color: var(--color-text-muted);
  line-height: 1.6;
  font-weight: normal;
}

/* Fix JSON Scene sizing in image stack */

.project-image-stack .unicorn-scene {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}


/* Project Page Content Adjustments */
.project-page .project-content {
  display: block;
  margin-top: 0;
  margin-bottom: 6rem;
}

.project-page .project-body {
  max-width: 100%;
}

.project-page .project-body p {
  font-size: var(--size-md);
  line-height: 1.6;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

/* Final Project Info Grid Refinements (2200px wide) */
.project-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--color-border);
}

/* --- Project Detail Page Stylings (Final Consolidated Version) --- */
.project-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-bottom: 2rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.project-header-left {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.project-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.6rem !important;
  background: var(--color-bg-secondary) !important;
  border: 1px solid var(--color-border) !important;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text) !important;
  text-decoration: none;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  line-height: 1 !important;
}

.project-back:hover {
  background: var(--color-bg) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  border-color: var(--color-border) !important;
}

.project-back-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.project-meta-details {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  line-height: 1;
}

.project-category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}

.project-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Only add margin when below the intro */
.project-scope.mobile-only {
  margin-top: 1rem;
}

.scope-pill {
  font-size: var(--size-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  line-height: 1;
}

.project-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2xl) var(--space-3xl);
  margin-bottom: 4rem;
}

.info-block h4 {
  font-size: 1rem;
  line-height: 1.4;
  color: var(--color-text);
  /* Darker, as seen in the screenshot */
  margin-bottom: 0.75rem;
  font-weight: 700;
  text-transform: none !important;
  letter-spacing: -0.01em;
}

.info-block p {
  font-size: var(--size-md);
  color: var(--color-text-muted);
  /* Muted text as seen in the screenshot */
  line-height: 1.5;
  margin: 0;
  font-weight: 450;
  max-width: 95%;
}

@media (max-width: 1024px) {
  .project-header-top {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .project-header-left {
    width: 100%;
  }

  .project-scope.mobile-only {
    justify-content: flex-start;
  }
}

@media (max-width: 768px) {
  .project-page {
    padding-left: 0;
    padding-right: 0;
    padding-top: var(--space-xl);
  }

  .project-header,
  .project-content,
  .project-page .site-footer {
    padding-left: var(--space-md) !important;
    padding-right: var(--space-md) !important;
    box-sizing: border-box;
  }

  /* Edge-to-edge images on mobile */
  .project-image-stack,
  .project-gallery {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
  }

  .project-image-stack .image-container,
  .project-gallery .image-container {
    border-radius: 0 !important;
  }

  .project-info-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

/* Theme Hint Tooltip & Animation */
.theme-hint-tooltip {
  position: absolute;
  bottom: 140%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(128, 128, 128, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--color-text);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(128, 128, 128, 0.2);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  animation: fadeInOut 5s ease-in-out forwards;
  animation-delay: 1s;
  display: none;
  /* Hide tooltip but keep element for pulse trigger */
  z-index: 100;
}

/* Triangle removed for minimal pill look */

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, 5px);
  }

  10% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  85% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -5px);
  }
}

/* Pulse animation for the button */
.theme-toggle-wrapper:has(.theme-hint-tooltip) .theme-toggle {
  animation: pulseRing 2s infinite;
}

@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 rgba(128, 128, 128, 0.4);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(128, 128, 128, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(128, 128, 128, 0);
  }
}

/* More Work Section (Home) */
.more-work-section {
  padding-bottom: var(--space-2xl);
  margin-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--color-border);
  margin-top: var(--space-xl);
}

.more-work-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.work-tile {
  display: block;
  position: relative;
  border-radius: var(--radius-l);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: var(--color-bg-secondary);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
  border: 1px solid var(--color-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.work-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.08);
}

.tile-image-wrapper {
  width: 100%;
  height: 100%;
}

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

.work-tile:hover img {
  transform: scale(1.05);
}

.intro-tile {
  container-type: inline-size;
  container-name: intro-tile;
  background: var(--color-bg-secondary);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--space-md);
  text-decoration: none;
  border: 1px solid var(--color-border);
}

.intro-arrow-wrapper {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.intro-arrow {
  /* scale with tile; balanced for ~270px tile and up */
  font-size: clamp(1.15rem, 5cqw, 2.25rem);
  line-height: 1;
  font-weight: 300;
  transition: transform var(--transition-short, 200ms) ease;
  margin-right: -0.25rem;
  margin-top: -0.25rem;
}

.intro-content {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  text-align: left;
  margin-top: auto;
  min-height: 0;
  flex-shrink: 0;
}

.intro-title {
  font-family: var(--font-display);
  /* cqw scales with tile: prominent on big screens, min on small */
  font-size: clamp(1.15rem, 4.5cqw, 2.35rem);
  line-height: 1.1;
  font-weight: 500;
  margin: 0;
  color: inherit;
  word-wrap: break-word;
  max-width: 100%;
  /* prevent title from pushing subtitle out of tile */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.intro-subtitle {
  /* scales with container; compact so it doesn't get cut off */
  font-size: clamp(1.0rem, 2.6cqw, 0.85rem);
  font-family: var(--font-body);
  color: var(--color-text-muted);
  font-weight: 400;
  flex-shrink: 0;
}

/* Narrow tiles: shrink content so subtitle isn’t clipped */
@container intro-tile (max-width: 360px) {
  .intro-title {
    font-size: clamp(0.85rem, 12.2cqw, 8rem);
  }
  .intro-subtitle {
    font-size: clamp(1.0rem, 2.2cqw, 1.3rem);
  }
  .intro-arrow {
    font-size: clamp(0.9rem, 4cqw, 1.35rem);
  }
  .intro-content {
    gap: 0.0625rem;
  }
}

.intro-tile:hover .intro-arrow {
  transform: translate(4px, -4px);
}

@media (max-width: 900px) {
  .more-work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .more-work-section {
    margin-top: var(--space-xl);
  }

  .more-work-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--space-sm);
    padding-bottom: var(--space-md);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .more-work-grid::-webkit-scrollbar {
    display: none;
  }

  .work-tile {
    flex: 0 0 70%;
    scroll-snap-align: start;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-m);
  }

  .intro-tile {
    padding: var(--space-sm);
  }

  .intro-title {
    line-height: 1.1;
  }

  .intro-subtitle {
    margin-top: 0;
  }
}

/* Email Copy Tooltip */
.copy-email-btn {
  position: relative;
  cursor: pointer;
}

.copy-email-btn::after {
  content: 'Email Copied!';
  position: absolute;
  top: -3.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--color-text);
  color: var(--color-bg);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-m);
  font-size: var(--size-xs);
  font-family: var(--font-body);
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 10000;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.copy-email-btn.copied::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* Ensure tooltip is visible above other elements */
.sidebar .copy-email-btn::after {
  top: -4rem;
}

.footer-link-item.copy-email-btn::after {
  top: -3rem;
}