/* ============================================================================
   IMPORTS & VARIABLES
   ============================================================================ */

@import url("https://fonts.googleapis.com/css2?family=Spectral:wght@400;600&family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  /* Colors */
  --background: 0 0% 100%;
  --foreground: 0 0% 0%;
  --card: 0 0% 100%;
  --card-foreground: 0 0% 0%;
  --primary: 0 0% 0%;
  --primary-foreground: 0 0% 100%;
  --secondary: 0 0% 85%;
  --secondary-foreground: 0 0% 0%;
  --muted: 0 0% 85%;
  --muted-foreground: 0 0% 40%;
  --border: 0 0% 85%;

  /* Spacing */
  --spacing-1: 0.25rem;
  --spacing-2: 0.5rem;
  --spacing-3: 0.75rem;
  --spacing-4: 1rem;
  --spacing-6: 1.5rem;
  --spacing-8: 2rem;
  --spacing-12: 3rem;
  --spacing-20: 5rem;
  --spacing-32: 8rem;

  /* Typography */
  --radius: 0.5rem;
}

/* ============================================================================
   RESET & BASE STYLES
   ============================================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-color: hsl(var(--border));
}

html,
body {
  height: 100%;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: hsl(var(--background));
  background-image: radial-gradient(
    circle at var(--gradient-x, 50%) var(--gradient-y, 50%),
    rgba(var(--gradient-color-center, 255, 220, 200), var(--gradient-opacity, 0.6)) 15%,
    rgba(var(--gradient-color-middle, 255, 230, 220), calc(var(--gradient-opacity, 0.6) * 0.6)) 40%,
    rgba(255, 255, 255, 0) 70%
  );
  background-attachment: fixed;
  color: hsl(var(--foreground));
  font-family: 'Spectral', serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  position: relative;
}

body > .flex.flex-col.min-h-screen {
  height: 100%;
}

/* ============================================================================
   TYPOGRAPHY
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

p, span, li, a, button, label, td, th {
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre, code {
  overflow-x: auto;
  white-space: pre;
  font-family: 'Courier New', monospace;
}

/* ============================================================================
   LAYOUT UTILITIES
   ============================================================================ */

/* Display */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-start {
  align-items: flex-start;
}

.items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-center {
  justify-content: center;
}

.min-h-screen {
  min-height: 100vh;
}

.flex-1 {
  flex: 1;
}

/* Sizing */
.w-full {
  width: 100%;
}

.max-w-\[605px\] {
  max-width: 605px;
}

.max-w-\[587px\] {
  max-width: 587px;
}

.max-w-4xl {
  max-width: 56rem;
}

.min-w-\[280px\] {
  min-width: 280px;
}

/* Aspect Ratio */
.aspect-\[587\/467\] {
  aspect-ratio: 587 / 467;
}

/* Overflow */
.overflow-hidden {
  overflow: hidden;
}

/* ============================================================================
   SPACING UTILITIES
   ============================================================================ */

/* Padding */
.px-3 {
  padding-left: var(--spacing-3);
  padding-right: var(--spacing-3);
}

.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.px-6 {
  padding-left: var(--spacing-6);
  padding-right: var(--spacing-6);
}

.px-8 {
  padding-left: 2rem;
  padding-right: 2rem;
}

.px-12 {
  padding-left: 3rem;
  padding-right: 3rem;
}

.px-24 {
  padding-left: 6rem;
  padding-right: 6rem;
}

.py-3 {
  padding-top: var(--spacing-3);
  padding-bottom: var(--spacing-3);
}

.py-6 {
  padding-top: var(--spacing-6);
  padding-bottom: var(--spacing-6);
}

.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.py-20 {
  padding-top: var(--spacing-20);
  padding-bottom: var(--spacing-20);
}

/* Margin */
.mb-1 {
  margin-bottom: 0.25rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-3 {
  margin-bottom: var(--spacing-3);
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

.mt-0 {
  margin-top: 0;
}

/* Gap */
.gap-1 {
  gap: 0.25rem;
}

.gap-3 {
  gap: var(--spacing-3);
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: var(--spacing-6);
}

/* ============================================================================
   TYPOGRAPHY UTILITIES
   ============================================================================ */

/* Font Family */
.font-grotesk {
  font-family: 'Space Grotesk', sans-serif;
}

.font-spectral {
  font-family: 'Spectral', serif;
}

/* Font Size */
.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.text-4xl {
  font-size: 2.25rem;
}

.text-5xl {
  font-size: 3rem;
}

.text-6xl {
  font-size: 3.75rem;
}

/* Font Weight */
.font-normal {
  font-weight: 400;
}

.font-semibold {
  font-weight: 600;
}

/* Line Height */
.leading-none {
  line-height: 1;
}

.leading-\[1\.1\] {
  line-height: 1.1;
}

/* Text Color */
.text-black {
  color: hsl(var(--foreground));
}

/* Link Styling */
a {
  color: hsl(var(--foreground)) !important;
}

a:visited {
  color: hsl(var(--foreground)) !important;
}

a:hover {
  color: hsl(var(--foreground)) !important;
}

a:active {
  color: hsl(var(--foreground)) !important;
}

header a.brand {
  color: hsl(var(--foreground)) !important;
  text-decoration: none;
  display: block;
}

header a.brand h1 {
  color: hsl(var(--foreground)) !important;
}

header a.brand p {
  color: hsl(var(--foreground)) !important;
}

header a.brand:visited h1,
header a.brand:visited p {
  color: hsl(var(--foreground)) !important;
}

header a.brand:hover h1,
header a.brand:hover p {
  color: hsl(var(--foreground)) !important;
}

/* ============================================================================
   COLOR UTILITIES
   ============================================================================ */

.bg-white {
  background-color: hsl(var(--background));
}

.bg-\[#D9D9D9\] {
  background-color: #D9D9D9;
  opacity: 0.2;
}

/* ============================================================================
   INTERACTIVE & STATES
   ============================================================================ */

/* Cursor */
.cursor-pointer {
  cursor: pointer;
}

/* Transitions & Transforms */
.transition-opacity {
  transition: opacity 300ms ease-out;
}

.transition-transform {
  transition: transform 300ms ease-out;
}

.hover\:opacity-70:hover {
  opacity: 0.7;
}

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

@keyframes magnify {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

@keyframes image-zoom {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.1);
  }
}

.animate-magnify {
  animation: magnify 300ms ease-out forwards;
}

.animate-image-zoom {
  animation: image-zoom 300ms ease-out forwards;
}

/* ============================================================================
   COMPONENT STYLES
   ============================================================================ */

/* Header */
header {
  width: 100%;
  padding: var(--spacing-3);
}

header > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  gap: 1rem;
  width: 100%;
}

header h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.25rem !important;
  line-height: 1;
  color: hsl(var(--foreground));
  margin-bottom: 0;
}

header p {
  font-family: 'Spectral', serif;
  font-size: 1.125rem;
  color: hsl(var(--foreground));
}

header .brand {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
}

header .brand h1,
header .brand p {
  white-space: nowrap;
}

header a.contact-link,
header a.portfolio-link {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: opacity 300ms ease-out;
  white-space: nowrap;
  flex-shrink: 0;
  margin-right: 2rem;
}

header a.contact-link {
  display: block;
}


header a.contact-link:hover,
header a.portfolio-link:hover {
  opacity: 0.7;
}

/* Hero Section with Typewriter */
.hero-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  width: 100%;
}

@media (min-width: 768px) {
  .hero-section {
    padding: 2rem var(--spacing-6);
  }
}

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

.hero-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 100vw;
  align-items: center;
  justify-content: center;
}

.typewriter-text {
  font-family: 'Spectral', serif;
  font-size: 2rem;
  color: hsl(var(--foreground));
  line-height: 1.6;
  text-align: center;
}

.typewriter-hint {
  font-family: 'Spectral', serif;
  font-size: 1rem;
  color: rgba(0, 0, 0, 0.5);
  line-height: 1.6;
  text-align: center;
  opacity: 0;
  transition: opacity 600ms ease-out;
  margin-top: 1rem;
}

.typewriter-hint.visible {
  opacity: 1;
}

.scroll-arrow {
  color: hsl(var(--foreground));
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 600ms ease-out, transform 600ms ease-out;
  cursor: pointer;
  margin-top: 144px;
  align-self: center;
}

.scroll-arrow.scroll-arrow-visible {
  opacity: 1;
  transform: translateY(0);
  animation: bounceArrow 2s ease-in-out 600ms infinite;
}

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

.scroll-arrow:hover {
  opacity: 0.7;
}

.typewriter-text::after {
  content: '|';
  animation: blink 1s infinite;
  margin-left: 2px;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* Main Content */
main {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  width: 100%;
  padding: 1rem;
}

.section.active {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: flex-start;
  flex-direction: column;
  gap: var(--spacing-32);
}

#portfolio-list.section.active {
  display: flex !important;
  padding: 0;
  margin: 0;
  gap: 0;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: auto !important;
  height: auto !important;
  position: relative !important;
  z-index: 1 !important;
}

#portfolio-list.section {
  display: none;
}

main:has(#portfolio-list.active) {
  padding-top: 0;
}

body:has(#portfolio-list.active) {
  --gradient-opacity: 0.2;
}

/* Lower hover opacity on portfolio list page for cursor color change */
body:has(#portfolio-list.active):hover {
  --gradient-opacity: 0.15;
}

.portfolio-container,
.portfolio-container-right {
  max-width: 800px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--spacing-8);
  transition: transform 300ms ease-out;
  height: auto;
  min-height: auto;
}

.portfolio-container-right {
  margin-left: auto;
}

.portfolio-container:first-of-type .portfolio-image,
.portfolio-container:first-of-type .portfolio-image-small {
  background-color: rgba(82, 137, 242, 0.8) !important;
}

.portfolio-container:first-of-type .portfolio-image img,
.portfolio-container:first-of-type .portfolio-image-small img {
  margin-left: 2rem;
  margin-right: 2rem;
}

#portfolio-item-2,
#portfolio-item-3 {
  flex-direction: column !important;
  align-items: flex-start;
}

#portfolio-item-1,
#portfolio-item-2 {
  cursor: default;
  transition: opacity 200ms ease-out;
}

#portfolio-item-1:hover,
#portfolio-item-2:hover {
  opacity: 0.8;
}

#portfolio-item-2 .portfolio-image,
#portfolio-item-3 .portfolio-image {
  width: 100%;
  max-width: 100%;
}

#portfolio-item-2 .portfolio-details-wrapper,
#portfolio-item-3 .portfolio-details-wrapper {
  width: 100%;
  max-width: 800px;
}


.portfolio-image {
  width: 100%;
  max-width: 800px;
  overflow: visible;
  transition: transform 300ms ease-out, box-shadow 300ms ease-out;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  
}

.portfolio-image-padded {
  padding-top: 1rem;
  padding-bottom: 1rem;
  padding-left: 4rem;
  padding-right: 4rem;
  background-color: rgba(218, 218, 218, 0.35);
}

.portfolio-image-padded img {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: high-quality;
  image-rendering: auto;
  -ms-interpolation-mode: nearest-neighbor;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.portfolio-image.portfolio-image-large {
  max-width: 800px !important;
}

/* Consolidated portfolio image max-width rules */
.portfolio-image-small,
.portfolio-image-full-width,
.portfolio-container-right:has(.portfolio-image-large),
.portfolio-container-right:has(.portfolio-image-full-width) {
  max-width: 800px;
}

.portfolio-container-right:has(.portfolio-image-large) {
  border-radius: 4px;
}

.portfolio-image-full-width {
  align-items: center;
  justify-content: center;
}

.portfolio-image-full-width img {
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  max-width: 800px;
  height: auto;
  image-rendering: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.portfolio-image-full-width img[src$=".svg"],
.portfolio-image-full-width img[src$=".SVG"],
.portfolio-image-full-width img[src*=".svg"],
.portfolio-image-full-width img[src*=".SVG"] {
  image-rendering: auto !important;
  shape-rendering: geometricPrecision;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.portfolio-image-full-width img[src$=".png"],
.portfolio-image-full-width img[src$=".PNG"] {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: high-quality;
  image-rendering: auto;
  -ms-interpolation-mode: nearest-neighbor;
}

.portfolio-image img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
  transition: transform 300ms ease-out;
  margin-left: 0;
  margin-right: 0;
  border-radius: 4px;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: high-quality;
  image-rendering: auto;
}

/* Only apply side margins to images with padding containers */
.portfolio-image-padded img,
.portfolio-container:first-of-type .portfolio-image img {
  margin-left: 2rem;
  margin-right: 2rem;
}

@media (max-width: 767px) {
  .portfolio-image img {
    margin-left: 0;
    margin-right: 0;
  }

  .portfolio-container,
  .portfolio-container-right {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.5rem !important;
  }

  .portfolio-details-wrapper {
    flex-direction: column !important;
    gap: 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

.portfolio-image img[src$=".png"],
.portfolio-image img[src$=".PNG"] {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: high-quality;
  image-rendering: auto;
}

.portfolio-details-wrapper {
  width: 100%;
  max-width: 800px;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  position: relative;
}

/* Ensure details wrapper width matches image width for regular portfolio items */
.portfolio-container:not(:has(.portfolio-image-full-width)):not(:has(.portfolio-image-padded)) .portfolio-details-wrapper {
  max-width: 100%;
  width: 100%;
}

.portfolio-button {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid hsl(var(--foreground));
  border-radius: 4px;
  background-color: transparent;
  color: hsl(var(--foreground));
  cursor: pointer;
  transition: opacity 300ms ease-out;
  align-self: flex-start;
  position: absolute;
  right: 0;
  top: 0;
}

.portfolio-button:hover {
  opacity: 0.7;
}

.portfolio-details {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  opacity: 1;
  transition: opacity 300ms ease-out;
}

.portfolio-details > div {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}

.portfolio-description {
  flex: 1;
  max-width: 100%;
  width: 100%;
  font-family: 'Spectral', serif;
  font-size: 1.125rem;
  color: hsl(var(--foreground));
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

#portfolio-item-1 .portfolio-description {
  max-width: none;
  flex: 1;
  width: 100%;
}

#portfolio-item-1 .portfolio-details {
  width: 100%;
}

#portfolio-item-1 .portfolio-details > div {
  flex-shrink: 0;
}

.portfolio-details h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  line-height: 1.1;
  color: hsl(var(--foreground));
  text-align: left;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.portfolio-details h3 {
  font-family: 'Spectral', serif;
  font-size: 1rem;
  font-weight: 400;
  color: hsl(var(--foreground));
  text-align: left;
}

.portfolio-details p {
  font-family: 'Spectral', serif;
  font-size: 1.125rem;  
  color: hsl(var(--foreground));
  text-align: left;
}

.portfolio-container-right .portfolio-details-wrapper {
  justify-content: flex-start;
}

.portfolio-container-right .portfolio-details {
  align-items: flex-start;
}

.badge-group {
  display: none;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 300ms ease-out;
}

.portfolio-container:hover .badge-group,
.portfolio-container-right:hover .badge-group {
  opacity: 1;
}

.badge {
  height: 40px;
  padding: 0 1.25rem;
  border-radius: 50px;
  background-color: hsl(var(--muted));
  color: hsl(var(--foreground));
  font-family: 'Spectral', serif;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  width: fit-content;
}


/* Footer */
footer {
  width: 100%;
  padding: 1.5rem 1rem;
}

footer a {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  display: inline-block;
  transition: opacity 300ms ease-out;
}

footer a:hover {
  opacity: 0.7;
}

.footer-text {
  font-family: 'Spectral', serif;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  margin-top: 1rem;
  opacity: 0.7;
}

/* About Page */

.about-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
}

.about-overlay.active,
#contact-overlay.active,
#portfolio-password-overlay.active {
  display: flex;
}

.about-overlay-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  border: none;
  background-color: transparent;
  color: hsl(var(--foreground));
  font-size: 2.5rem;
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 300ms ease-out;
  padding: 0;
}

.about-overlay-close:hover,
.contact-overlay-close:hover,
.portfolio-password-close:hover {
  opacity: 0.7;
}

.contact-overlay-close,
.portfolio-password-close {
  position: fixed;
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  border: none;
  background-color: transparent;
  color: hsl(var(--foreground));
  font-size: 2.5rem;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 200ms ease-out;
  line-height: 1;
}

.portfolio-password-content input:focus {
  border-color: black;
}

.portfolio-password-content button:hover {
  opacity: 0.7;
  background-color: rgba(0, 0, 0, 0.05);
}

.about-overlay-content {
  width: 100%;
  max-width: 56rem;
  margin: 2rem auto;
  padding: 0 1rem;
}

.about-overlay .about-content {
  min-height: auto;
  background-color: transparent;
}

.about-overlay .about-content a {
  color: hsl(var(--foreground));
  text-decoration: underline;
  transition: opacity 200ms ease-out;
}

.about-overlay .about-content a:hover {
  opacity: 0.7;
}


.portfolio-list-content {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0 1rem;
  padding-top: 1rem;
  width: 80vw;
  max-width: 80vw;
  margin: 0 auto;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 100px !important;
  height: auto !important;
  position: relative !important;
  z-index: 1 !important;
}

.portfolio-tabs {
  display: flex;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  padding: 1rem 0;
  border-bottom: 2px solid hsl(var(--foreground));
  white-space: nowrap;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
}

.portfolio-tab {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  color: hsl(var(--foreground));
  background: none;
  border: none;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  transition: opacity 200ms ease-out;
  position: relative;
  white-space: nowrap;
  flex-shrink: 0;
}

.portfolio-tab:hover {
  opacity: 0.7;
}

.portfolio-tab.active {
  opacity: 1;
  font-weight: 600;
}

.portfolio-tab-content {
  width: 100% !important;
  max-width: 100% !important;
  padding: 2rem 0 !important;
  margin: 0 auto;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  overflow-x: visible;
  visibility: visible !important;
  opacity: 1 !important;
}

.tab-pane {
  display: none;
  width: 100%;
  overflow: visible;
}

.tab-pane.active {
  display: block !important;
  overflow: visible;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  min-height: auto !important;
}

/* Ensure inactive tab panes are hidden */
.tab-pane:not(.active) {
  display: none !important;
}

.trial-signup-content {
  display: flex !important;
  flex-direction: column;
  gap: 8rem;
  width: 100%;
  align-items: flex-start;
  visibility: visible !important;
  opacity: 1 !important;
  margin-top: 2rem;
}

/* Common base styles for portfolio list sections */
.phase-section,
.subscription-funnel,
.understanding-user-needs,
.competitor-analysis,
.proposed-changes-wrapper,
.flow-diagram-wrapper,
.flow-diagram,
.design-section,
.outcomes-section {
  align-self: flex-start;
}

.phase-section,
.subscription-funnel,
.understanding-user-needs,
.competitor-analysis,
.proposed-changes-wrapper,
.flow-diagram-wrapper,
.design-section,
.outcomes-section {
  width: 100%;
}

.introduction-section {
  width: 100%;
  margin-bottom: 0;
}

.introduction-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
}

.introduction-image {
  flex: 0 0 auto;
  min-width: 500px;
  max-width: 1000px;
  width: 100%;
}

.introduction-image img {
  width: 100%;
  height: auto;
  max-height: 800px;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Billing codes introduction image - 25% smaller */
.introduction-image-billing {
  min-width: 375px;
  max-width: 750px;
}

.introduction-image-billing img {
  max-height: 600px;
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: high-quality !important;
  image-rendering: auto !important;
  -ms-interpolation-mode: bicubic !important;
  transform: translateZ(0) !important;
  -webkit-transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  will-change: transform !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

#tab-billing-codes .introduction-section {
  margin-bottom: 3rem;
}

/* Ensure billing codes introduction image gets high-resolution rendering */
#tab-billing-codes .introduction-image-billing img {
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: high-quality !important;
  image-rendering: auto !important;
  -ms-interpolation-mode: bicubic !important;
  transform: translateZ(0) !important;
  -webkit-transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  will-change: transform !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

#tab-billing-codes .phase-container:first-of-type {
  margin-bottom: 3rem;
}

#tab-trial-signup .introduction-image {
  width: fit-content;
  min-width: auto;
  max-width: none;
}

#tab-trial-signup .introduction-image img {
  width: auto;
  max-width: 100%;
}

.introduction-text {
  flex: 1;
}

.introduction-text h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.introduction-text h4 {
  font-family: 'Spectral', serif;
  font-size: 1.5rem;
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
  font-weight: normal;
}

.introduction-text p {
  font-family: 'Spectral', serif;
  font-size: 1.375rem;
  color: hsl(var(--foreground));
  line-height: 1.8;
}

.phase-container {
  margin-bottom: 0;
  width: 100%;
}

.phase-container + .phase-container {
  margin-top: 0;
}

/* Consistent spacing between phases - add explicit margin since other elements are between them */
#tab-billing-codes .phase-container:not(:first-of-type) {
  margin-top: 8rem !important;
}

#tab-trial-signup .phase-container + .phase-container {
  margin-top: 0;
}

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

.phase-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.phase-section h4 {
  font-family: 'Spectral', serif;
  font-size: 1.5rem;
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
  font-weight: 600;
}

.phase-section ul {
  font-family: 'Spectral', serif;
  font-size: 1.375rem;
  color: hsl(var(--foreground));
  line-height: 1.8;
  padding-left: 1.5rem;
}

.subscription-funnel {
  margin: 2rem 0;
}

.subscription-funnel h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  color: hsl(var(--foreground));
  margin-bottom: 1.5rem;
}

.funnel-flow {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.funnel-stage {
  padding: 1.5rem 2rem;
  border: 2px solid hsl(var(--foreground));
  border-radius: 8px;
  text-align: center;
  flex: 1;
  min-width: 200px;
  max-width: 250px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.funnel-light {
  background-color: transparent;
}

.funnel-medium {
  background-color: rgba(128, 128, 128, 0.25);
}

.funnel-stage h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.125rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.funnel-stage p {
  font-family: 'Spectral', serif;
  font-size: 1rem;
  color: hsl(var(--foreground));
  margin: 0;
}

.funnel-arrow {
  font-size: 2rem;
  color: hsl(var(--foreground));
  flex-shrink: 0;
}

.understanding-user-needs {
  margin: 2rem 0;
}

.understanding-user-needs h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  color: hsl(var(--foreground));
  margin-bottom: 1.5rem;
}

.user-needs-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 3rem;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.user-needs-circle {
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid hsl(var(--foreground));
}

.understanding-user-needs h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  color: hsl(var(--foreground));
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.competitor-analysis h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  color: hsl(var(--foreground));
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.competitor-analysis ul {
  font-family: 'Spectral', serif;
  font-size: 1.375rem;
  color: hsl(var(--foreground));
  line-height: 1.8;
  padding-left: 1.5rem;
  margin-top: 0;
  margin-bottom: 0;
}

.competitor-analysis .user-needs-list {
  gap: 0.5rem;
}

.user-needs-list {
  list-style: disc;
  padding-left: 1.5rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-width: 300px;
  max-width: none;
}

.competitor-analysis .user-needs-list {
  gap: 0.5rem;
}

.user-needs-list li {
  font-family: 'Spectral', serif;
  font-size: 1.125rem;
  color: hsl(var(--foreground));
  line-height: 1.6;
}

.circle-line-1,
.circle-line-2,
.circle-line-3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  line-height: 1.2;
  text-align: center;
}

.competitor-analysis h4,
.proposed-changes-wrapper h4,
.design-section h4,
.outcomes-section h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  color: hsl(var(--foreground));
  margin-bottom: 1.5rem;
}

.competitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.competitor-item {
  padding: 1rem;
  border: 1px solid hsl(var(--foreground));
  border-radius: 4px;
}

.competitor-item:not(.competitor-item-playback) {
  background-color: rgba(128, 128, 128, 0.25);
}

.competitor-item h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.competitor-item p {
  font-family: 'Spectral', serif;
  font-size: 1rem;
  color: hsl(var(--muted-foreground));
}

.competitor-item-playback {
  background-color: transparent;
}

.proposed-changes-wrapper {
  margin: 2rem 0;
}

.flow-comparison {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  border: 1px solid hsl(var(--foreground));
  border-radius: 4px;
  width: fit-content;
  max-width: 100%;
}

.old-flow,
.new-flow {
  flex: 0 0 auto;
}

.arrow {
  font-size: 2rem;
  color: hsl(var(--foreground));
  flex-shrink: 0;
  flex-grow: 0;
}

.old-flow h5,
.new-flow h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.old-flow p,
.new-flow p {
  font-family: 'Spectral', serif;
  font-size: 1rem;
  color: hsl(var(--muted-foreground));
}

.flow-diagram {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 2rem;
  border: 1px solid hsl(var(--foreground));
  border-radius: 4px;
  margin-bottom: 2rem;
  max-width: fit-content;
  width: fit-content;
  overflow: visible;
}

@media (max-width: 767px) {
  .flow-diagram {
    max-width: fit-content;
    width: fit-content;
    padding: 1rem;
  }
}

.flow-diagram-wrapper {
  margin: 2rem 0 0 0;
}

/* Ensure flow-diagram-wrapper at end of phase-container doesn't add extra spacing */
.phase-container .flow-diagram-wrapper:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
}

.flow-diagram-wrapper h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  color: hsl(var(--foreground));
  margin-bottom: 1.5rem;
}

.design-principles-inline {
  margin-bottom: 2rem;
}

.design-principles-inline h5 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
  font-weight: 600;
}

.design-principles-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.design-principles-list li {
  font-family: 'Spectral', serif;
  font-size: 1.125rem;
  color: hsl(var(--foreground));
  line-height: 1.6;
  position: relative;
  padding-left: 1.25rem;
}

.design-principles-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: hsl(var(--foreground));
  font-weight: bold;
}

.flow-diagram-description {
  font-family: 'Spectral', serif;
  font-size: 1.375rem;
  color: hsl(var(--foreground));
  line-height: 1.8;
  margin-top: 0;
  margin-bottom: 1.5rem;
  width: 100%;
}

.flow-diagram-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 1.5rem;
  flex-wrap: wrap;
  overflow: visible;
  padding: 1rem 0;
  width: 100%;
}

.flow-start,
.flow-end {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: hsl(var(--foreground));
  background-color: rgba(128, 128, 128, 0.25);
  border: 2px solid hsl(var(--foreground));
  border-radius: 4px;
  padding: 0.75rem 1.5rem;
  min-width: 150px;
  text-align: center;
  flex-shrink: 0;
}

.flow-info {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  background-color: transparent;
  border: 2px solid hsl(var(--foreground));
  padding: 0.75rem 1.5rem;
  min-width: 150px;
  text-align: center;
  flex-shrink: 0;
  position: relative;
  transform: none;
}

/* Make flow structure responsive to viewport width on billing code page */
#tab-billing-codes .flow-info {
  font-size: clamp(0.6rem, 1vw, 0.75rem) !important;
  padding: clamp(0.3rem, 0.5vw, 0.5rem) clamp(0.5rem, 1vw, 0.75rem) !important;
  min-width: clamp(80px, 8vw, 120px) !important;
  line-height: 1.2;
}

/* Reduce size of flow start/end on billing code page */
#tab-billing-codes .flow-start,
#tab-billing-codes .flow-end {
  font-size: clamp(0.7rem, 1.2vw, 0.875rem) !important;
  padding: clamp(0.3rem, 0.5vw, 0.5rem) clamp(0.5rem, 1vw, 0.75rem) !important;
  min-width: clamp(80px, 8vw, 120px) !important;
}

/* Reduce arrow size on billing code page */
#tab-billing-codes .flow-arrow {
  font-size: clamp(0.875rem, 1.5vw, 1rem) !important;
  margin: 0 clamp(0.125rem, 0.3vw, 0.25rem) !important;
}

/* Reduce gap between flow elements on billing code page */
#tab-billing-codes .flow-diagram-content {
  gap: clamp(0.25rem, 0.8vw, 0.75rem) !important;
  flex-wrap: nowrap;
}

/* Apply same reduced gap to trial sign-up flow diagrams to ensure full flow fits on standard desktop screens */
#tab-trial-signup .flow-diagram-content {
  gap: 0.5rem !important;
  flex-wrap: nowrap;
}

/* Reduce diamond size on billing code page */
#tab-billing-codes .flow-diamond {
  width: clamp(60px, 6vw, 80px) !important;
  height: clamp(60px, 6vw, 80px) !important;
  font-size: clamp(0.6rem, 1vw, 0.75rem) !important;
}

.flow-info > * {
  display: inline-block;
  transform: none;
  line-height: 1.4;
}

.flow-info strong {
  font-weight: 700;
  display: block;
  margin-bottom: 0.125rem;
}

/* Reduce spacing in flow info on billing code page */
#tab-billing-codes .flow-info strong {
  margin-bottom: clamp(0.05rem, 0.15vw, 0.1rem) !important;
  font-size: clamp(0.65rem, 1.1vw, 0.8rem) !important;
}

.flow-diamond {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  background-color: transparent;
  border: 2px solid hsl(var(--foreground));
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  transform: rotate(45deg);
  margin: 0 0.5rem;
  flex-shrink: 0;
}

.flow-diamond::after {
  content: attr(data-text);
  position: absolute;
  transform: rotate(-45deg);
  padding: 0.5rem;
  white-space: pre-line;
  max-width: 150px;
  line-height: 1.4;
  text-align: center;
}

.flow-diamond[data-text="Trial Welcome"]::after {
  content: "Trial\AWelcome";
  white-space: pre;
}

.flow-item-with-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.flow-caption {
  font-family: 'Spectral', serif;
  font-size: 0.75rem;
  color: hsl(var(--foreground));
  text-align: left;
  opacity: 0.7;
  line-height: 1.3;
  max-width: 150px;
  word-wrap: break-word;
  margin-top: 0.5rem;
}

.flow-item-with-caption .flow-diamond + .flow-caption {
  max-width: 100px;
}

.flow-legend {
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--foreground));
  margin-top: 1rem;
}

.flow-legend h6 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.75rem;
  text-align: left;
}

.flow-legend .legend-items {
  display: flex;
  gap: 2rem;
  justify-content: space-evenly;
  flex-wrap: wrap;
  row-gap: 1rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Spectral', serif;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
}

.legend-shape {
  width: 40px;
  height: 24px;
  border: 2px solid hsl(var(--foreground));
  background-color: hsl(var(--background));
}

.legend-rectangle {
  border-radius: 4px;
}

.legend-parallelogram {
  transform: skew(-15deg);
  position: relative;
}

.legend-parallelogram::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: skew(15deg);
}

.legend-diamond {
  transform: rotate(45deg);
  width: 24px;
  height: 24px;
}

.legend-action {
  background-color: transparent;
  border-color: hsl(var(--foreground));
}

.legend-info {
  background-color: transparent;
  border-color: hsl(var(--foreground));
}

.legend-conversion {
  background-color: rgba(128, 128, 128, 0.25);
  border-color: hsl(var(--foreground));
}

.flow-arrow {
  font-size: 1.5rem;
  color: hsl(var(--foreground));
  line-height: 1;
  flex-shrink: 0;
}

.design-section {
  margin: 2rem 0;
}

.design-image-wrapper {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  margin-top: 0;
  margin-bottom: 1.5rem;
  width: fit-content;
  max-width: 100%;
}

.design-image-wrapper .portfolio-image {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 2rem;
  width: 100%;
  max-width: 100%;
}

/* Decrease horizontal spacing between images on billing code tab (including Phase 3) */
#tab-billing-codes .design-image-wrapper .portfolio-image,
#tab-billing-codes .phase-container:last-of-type .design-image-wrapper .portfolio-image {
  gap: 0.5rem;
  flex-wrap: nowrap;
}

/* Apply same reduced spacing to trial sign-up tab to ensure full flow fits on standard desktop screens */
#tab-trial-signup .design-image-wrapper .portfolio-image {
  gap: 0.5rem;
  flex-wrap: nowrap;
}

/* Reduce arrow spacing between images on billing code tab (including Phase 3) */
#tab-billing-codes .design-image-wrapper .portfolio-image > div[style*="display: flex"],
#tab-billing-codes .phase-container:last-of-type .design-image-wrapper .portfolio-image > div[style*="display: flex"] {
  margin: 0 0.125rem !important;
}

/* Apply same reduced arrow spacing to trial sign-up tab */
#tab-trial-signup .design-image-wrapper .portfolio-image > div[style*="display: flex"] {
  margin: 0 0.125rem !important;
}

/* Make image group items more compact on billing code tab (including Phase 3) */
#tab-billing-codes .image-group-item,
#tab-billing-codes .phase-container:last-of-type .image-group-item {
flex-shrink: 1;
  min-width: auto;
}

/* Apply same compact sizing to trial sign-up tab */
#tab-trial-signup .image-group-item {
  flex-shrink: 1;
  min-width: auto;
}

.image-group-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  flex: 0 1 auto;
  min-width: 200px;
  max-width: none;
  gap: 0.75rem;
}

.design-image-wrapper .portfolio-image img {
  width: 100%;
  max-width: 100%;
  max-height: 50vh;
  height: auto;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: high-quality;
  image-rendering: auto;
  -ms-interpolation-mode: nearest-neighbor;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* Ensure consistent image size for all design sections on billing code page (from Layout and Content Blocks through Outcomes, including Phase 3) */
#tab-billing-codes .design-section .design-image-wrapper .portfolio-image img,
#tab-billing-codes .design-section .design-image-wrapper .portfolio-image .image-group-item img {
  max-height: 45vh !important;
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: high-quality !important;
  image-rendering: auto !important;
  -ms-interpolation-mode: bicubic !important;
  transform: translateZ(0) !important;
  -webkit-transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  will-change: transform !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Apply same image sizing to trial sign-up tab to ensure full flow fits on standard desktop screens */
#tab-trial-signup .design-section .design-image-wrapper .portfolio-image img,
#tab-trial-signup .design-section .design-image-wrapper .portfolio-image .image-group-item img {
  max-height: 45vh !important;
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: high-quality !important;
  image-rendering: auto !important;
  -ms-interpolation-mode: bicubic !important;
  transform: translateZ(0) !important;
  -webkit-transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  will-change: transform !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Apply same sizing to Phase 3 sections specifically */
#tab-billing-codes .phase-container:last-of-type .design-section .design-image-wrapper .portfolio-image img,
#tab-billing-codes .phase-container:last-of-type .design-section .design-image-wrapper .portfolio-image .image-group-item img {
  max-height: 45vh !important;
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: high-quality !important;
  image-rendering: auto !important;
  -ms-interpolation-mode: bicubic !important;
  transform: translateZ(0) !important;
  -webkit-transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  will-change: transform !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Increase image size for all Phase 3 sections with consistent high-quality rendering */
#previous-designs-section .design-image-wrapper .portfolio-image .image-group-item img,
#ui-updates-section .design-image-wrapper .portfolio-image .image-group-item img,
#design-library-section .design-image-wrapper .portfolio-image .image-group-item img,
.phase-section + .design-section .design-image-wrapper .portfolio-image .image-group-item img {
  max-height: 50vh !important;
  border: none;
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: high-quality !important;
  image-rendering: auto !important;
  -ms-interpolation-mode: bicubic !important;
  transform: translateZ(0) !important;
  -webkit-transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  will-change: transform !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Ensure both Previous Designs and UI Updates sections have identical rendering quality */
#previous-designs-section .design-image-wrapper .portfolio-image-padded img,
#ui-updates-section .design-image-wrapper .portfolio-image-padded img {
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: high-quality !important;
  image-rendering: auto !important;
  -ms-interpolation-mode: bicubic !important;
  transform: translateZ(0) !important;
  -webkit-transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  will-change: transform !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
  shape-rendering: geometricPrecision !important;
  text-rendering: optimizeLegibility !important;
}

#final-flow-section .final-flow-container .portfolio-image img,
.phase-section ~ .design-section .final-flow-container .portfolio-image img {
  max-height: 50vh !important;
  clip-path: inset(0 0 3px 6px);
  border: none !important;
}

/* Crop .gif in wireframes section on billing codes page by 5px on each side */
#tab-billing-codes .design-image-wrapper .portfolio-image img[src$=".gif"],
#tab-billing-codes .design-image-wrapper .portfolio-image img[src*="Layout3.gif"],
#tab-billing-codes .design-image-wrapper .portfolio-image .image-group-item img[src$=".gif"],
#tab-billing-codes .design-image-wrapper .portfolio-image .image-group-item img[src*="Layout3.gif"] {
  clip-path: inset(5px);
}

.image-group-item .design-image-caption {
  text-align: center;
  width: 100%;
  padding: 0;
  margin-top: 0;
}

/* Adjust spacing for Design Library section to fit 4 images in one row */
#design-library-section .portfolio-image {
  gap: 2% !important;
}

#design-library-section .image-group-item {
  width: calc((100% - 6%) / 4) !important;
}

.design-image-wrapper .portfolio-image img[src$=".png"],
.design-image-wrapper .portfolio-image img[src$=".PNG"],
.design-image-wrapper .portfolio-image img[src$=".jpg"],
.design-image-wrapper .portfolio-image img[src$=".JPG"],
.design-image-wrapper .portfolio-image img[src$=".jpeg"],
.design-image-wrapper .portfolio-image img[src$=".JPEG"] {
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: high-quality;
  image-rendering: auto;
  -ms-interpolation-mode: nearest-neighbor;
}

/* Apply high-quality rendering to SVG images in design sections for consistent quality */
.design-image-wrapper .portfolio-image img[src$=".svg"],
.design-image-wrapper .portfolio-image img[src$=".SVG"],
.design-image-wrapper .portfolio-image img[src*=".svg"],
.design-image-wrapper .portfolio-image img[src*=".SVG"],
.design-image-wrapper .portfolio-image .image-group-item img[src$=".svg"],
.design-image-wrapper .portfolio-image .image-group-item img[src$=".SVG"],
.design-image-wrapper .portfolio-image .image-group-item img[src*=".svg"],
.design-image-wrapper .portfolio-image .image-group-item img[src*=".SVG"] {
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: high-quality !important;
  image-rendering: auto !important;
  shape-rendering: geometricPrecision !important;
  text-rendering: optimizeLegibility !important;
  -ms-interpolation-mode: bicubic !important;
  transform: translateZ(0) !important;
  -webkit-transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  will-change: transform !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Increase resolution specifically for billing codes tab images */
#tab-billing-codes .design-image-wrapper .portfolio-image img[src$=".png"],
#tab-billing-codes .design-image-wrapper .portfolio-image img[src$=".PNG"],
#tab-billing-codes .design-image-wrapper .portfolio-image img[src$=".jpg"],
#tab-billing-codes .design-image-wrapper .portfolio-image img[src$=".JPG"],
#tab-billing-codes .design-image-wrapper .portfolio-image img[src$=".jpeg"],
#tab-billing-codes .design-image-wrapper .portfolio-image img[src$=".JPEG"],
#tab-billing-codes .design-image-wrapper .portfolio-image .image-group-item img[src$=".png"],
#tab-billing-codes .design-image-wrapper .portfolio-image .image-group-item img[src$=".PNG"],
#tab-billing-codes .design-image-wrapper .portfolio-image .image-group-item img[src$=".jpg"],
#tab-billing-codes .design-image-wrapper .portfolio-image .image-group-item img[src$=".JPG"],
#tab-billing-codes .design-image-wrapper .portfolio-image .image-group-item img[src$=".jpeg"],
#tab-billing-codes .design-image-wrapper .portfolio-image .image-group-item img[src$=".JPEG"] {
  image-rendering: -webkit-optimize-contrast !important;
  image-rendering: high-quality !important;
  image-rendering: auto !important;
  -ms-interpolation-mode: bicubic !important;
  transform: translateZ(0) !important;
  -webkit-transform: translateZ(0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  will-change: transform !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

.design-image-wrapper .portfolio-image .design-image-caption {
  text-align: center;
  width: 100%;
  padding: 0 1rem;
  margin-top: 0;
}

.design-image-captions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1.5rem;
  width: 100%;
  justify-content: flex-start;
}

.design-image-captions .design-image-caption {
  flex: 1 1 auto;
  min-width: 200px;
  max-width: calc(33.333% - 1rem);
  text-align: center;
}

.final-flow-container .portfolio-image {
  width: 100%;
  max-width: 100%;
}

.final-flow-container .portfolio-image img {
  width: 100%;
  max-width: 100%;
  max-height: 30vh;
  height: auto;
  object-fit: contain;
  clip-path: inset(0 0 3px 6px);
  border: 0.5px solid rgba(0, 0, 0, 0.5);
}

/* Remove borders from all portfolio list page images except .gif */
#portfolio-list .design-image-wrapper .portfolio-image img,
#portfolio-list .portfolio-image-padded img {
  border: none !important;
}

/* Ensure .gif keeps its border */
#final-flow-section .final-flow-container .portfolio-image img[src$=".gif"],
#final-flow-section .final-flow-container .portfolio-image img[src*="Screen Recording"] {
  border: none !important;
}

.design-image-caption {
  font-family: 'Spectral', serif;
  font-size: 0.875rem;
  color: hsl(var(--foreground));
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.final-flow-wrapper {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

#tab-trial-signup .final-flow-wrapper {
  align-items: flex-start;
  justify-content: flex-start;
  gap: 3rem;
}

#tab-trial-signup .outcomes-section-inline {
  align-items: flex-start;
  text-align: left;
  flex: 0 0 auto;
}

#tab-trial-signup .final-flow-wrapper .outcomes-cta-button {
  align-self: flex-end;
  margin-top: 0;
  margin-left: auto;
}

.final-flow-container {
  width: fit-content;
  max-width: 100%;
  margin-top: 0;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.final-flow-container img {
  max-width: 70%;
  max-height: 35vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

#tab-trial-signup .final-flow-container img {
  max-width: 700px;
  max-height: 50vh;
}

#tab-trial-signup #final-flow-section .final-flow-container img[src$=".gif"],
#tab-trial-signup #final-flow-section .final-flow-container img[src*="Screen Recording"] {
  max-width: 700px;
  max-height: 50vh;
  clip-path: inset(0 0 5px 5px);
}

.final-flow-container .portfolio-image-padded {
  padding-left: 4rem;
  padding-right: 4rem;
}

.outcomes-section-inline {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#tab-billing-codes .outcomes-section-inline {
  align-items: flex-start;
}

.outcomes-section-inline h4 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.75rem;
  color: hsl(var(--foreground));
  margin-bottom: 1.5rem;
  text-align: left;
}

.outcomes-section-inline .outcomes-description {
  font-family: 'Spectral', serif;
  font-size: 1.375rem;
  color: hsl(var(--foreground));
  line-height: 1.8;
  margin-top: 0;
  margin-bottom: 1.5rem;
  width: 100%;
}

.design-description {
  font-family: 'Spectral', serif;
  font-size: 1.375rem;
  color: hsl(var(--foreground));
  line-height: 1.8;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.outcomes-section {
  margin: 2rem 0;
}

.outcomes-section h4 {
  margin-bottom: 1.5rem;
}

.outcomes-grid {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  width: 100%;
  margin-top: 0;
  flex-wrap: nowrap;
}

.outcomes-section-inline .outcomes-grid {
  gap: 1.5rem;
}

#tab-billing-codes .outcomes-grid {
  justify-content: center;
}

#tab-billing-codes .outcome-item {
  align-items: flex-start;
}

#tab-billing-codes .outcome-label {
  text-align: left;
}

#tab-trial-signup .outcomes-grid {
  flex-direction: column;
  flex-wrap: wrap;
  align-items: flex-start;
}

#tab-trial-signup .outcome-item {
  max-width: fit-content;
  width: fit-content;
  align-items: flex-start;
}

#tab-trial-signup .outcome-label {
  text-align: left;
}

.outcomes-cta-button {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 200ms ease-out;
  margin-top: 2rem;
  align-self: flex-start;
  font-size: 1.25rem;
}

.outcomes-cta-button:hover {
  opacity: 0.7;
}

.outcomes-cta-button .arrow-icon {
  font-size: 1.5rem;
  transition: transform 200ms ease-out;
}

.outcomes-cta-button:hover .arrow-icon {
  transform: translateX(4px);
}

.outcome-item {
  padding: 2rem;
  border: 2px solid hsl(var(--foreground));
  border-radius: 4px;
  background-color: transparent;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  flex: 1 1 0;
  min-width: 0;
  max-width: 300px;
}

.outcome-metric {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 3rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: 0.75rem;
  line-height: 1;
}

.outcome-label {
  font-family: 'Spectral', serif;
  font-size: 1.125rem;
  color: hsl(var(--foreground));
  line-height: 1.6;
}

.outcomes-description {
  font-family: 'Spectral', serif;
  font-size: 1.375rem;
  color: hsl(var(--foreground));
  line-height: 1.8;
  margin-top: 0;
  margin-bottom: 1.5rem;
  text-align: left;
  width: 100%;
}

/* Removed unused mockup styles - UI Mockups section replaced */

.portfolio-section-nav {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  width: 100%;
  max-width: 56rem;
  padding: 0;
  padding-top: 1rem;
}

.portfolio-section-nav-item {
  text-decoration: none;
  color: hsl(var(--foreground));
  padding: 1.5rem;
  border: 2px solid hsl(var(--foreground));
  border-radius: 8px;
  transition: opacity 300ms ease-out, transform 300ms ease-out;
  display: block;
}

.portfolio-section-nav-item:hover {
  opacity: 0.7;
  transform: translateX(4px);
}

.portfolio-section-nav-item h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.875rem;
  line-height: 1.2;
  color: hsl(var(--foreground));
  margin-bottom: 0.5rem;
}

.portfolio-section-nav-item p {
  font-family: 'Spectral', serif;
  font-size: 1rem;
  color: hsl(var(--muted-foreground));
  margin: 0;
}

.about-content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.about-content h2,
.contact-content h2 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  color: hsl(var(--foreground));
  margin-bottom: 2rem;
}

.about-content > div > div,
.contact-content > div > div {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  font-family: 'Spectral', serif;
  font-size: 1.25rem;
  color: hsl(var(--foreground));
}

.about-content p,
.contact-content p {
  margin-bottom: 1.5rem;
}

.contact-section {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2rem;
}

.contact-section h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem;
  color: hsl(var(--foreground));
  margin-bottom: 1rem;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.contact-info p {
  font-family: 'Spectral', serif;
  font-size: 1.25rem;
  color: hsl(var(--foreground));
}

.contact-info a {
  font-family: 'Spectral', serif;
  font-size: 1.25rem;
  color: hsl(var(--foreground));
  text-decoration: underline;
  transition: opacity 300ms ease-out;
}

.contact-info a:hover {
  opacity: 0.7;
}

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

/* Tablet (768px and up) */
@media (min-width: 768px) {
  header {
    padding: var(--spacing-3) var(--spacing-6);
  }

  header h1 {
    font-size: 2.75rem !important;
  }

  header p {
    font-size: 1.25rem;
  }

  header a.contact-link,
  header a.portfolio-link {
    font-size: 1.875rem;
  }

  main {
    padding: 1rem var(--spacing-6);
  }

  .portfolio-details h2 {
    font-size: 2rem;
  }

  .portfolio-details h3 {
    font-size: 1.25rem;
  }

  .portfolio-details p {
    font-size: 1rem;
  }

  footer {
    padding: 1.5rem var(--spacing-8);
  }

  footer a {
    font-size: 1.875rem;
  }

  .about-content h2,
  .contact-content h2 {
    text-align: left;
    font-size: 2.75rem;
  }

  .about-content > div > div,
  .contact-content > div > div {
    font-size: 1.5rem;
  }
}

/* Desktop (1024px and up) */
@media (min-width: 1024px) {
  header {
    padding: var(--spacing-3) 3rem;
  }

  header h1 {
    font-size: 3.25rem !important;
  }

  header p {
    font-size: 1.5rem;
  }

  header a.contact-link,
  header a.portfolio-link {
    font-size: 1.875rem;
  }

  main {
    padding: 1rem 6rem;
  }

  .portfolio-details h2 {
    font-size: 2rem;
  }

  .about-content h2,
  .contact-content h2 {
    text-align: left;
    font-size: 3.75rem;
  }

  .about-content > div > div,
  .contact-content > div > div {
    font-size: 1.5rem;
  }

  footer {
    padding: 1.5rem 3.25rem;
  }
}

/* Other Work Section */
.other-work-section {
  width: 100%;
  max-width: 734px;
  margin-top: var(--spacing-12);
}

.other-work-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-4) 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2rem;
  color: hsl(var(--foreground));
  transition: opacity 200ms ease-out;
}

.other-work-toggle:hover {
  opacity: 0.7;
}

.toggle-icon {
  font-size: 2.5rem;
  transition: transform 300ms ease-out;
}

.other-work-toggle.expanded .toggle-icon {
  transform: rotate(45deg);
}

.other-work-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 400ms ease-out;
}

.other-work-content.expanded {
  max-height: 2000px;
}

.other-work-headline {
  font-family: 'Spectral', serif;
  font-size: 2rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-top: var(--spacing-8);
  margin-bottom: var(--spacing-4);
}

.other-work-subheadline {
  font-family: 'Spectral', serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: hsl(var(--muted-foreground));
  margin-bottom: var(--spacing-8);
}

.other-work-items {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-8);
}

.other-work-item {
  padding: var(--spacing-6) 0;
}

.other-work-item h4 {
  font-family: 'Spectral', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  margin-bottom: var(--spacing-2);
}

.project-link {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: opacity 200ms ease-out;
}

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

.arrow-icon {
  font-size: 1.25rem;
  transition: transform 200ms ease-out;
}

.project-link:hover .arrow-icon {
  transform: translateX(4px);
}

.other-work-item p {
  font-family: 'Spectral', serif;
  font-size: 1.125rem;
  color: hsl(var(--muted-foreground));
  line-height: 1.6;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  header {
    padding: var(--spacing-3);
  }

  main {
    padding: 3rem 1rem;
  }

  footer {
    padding: 1.5rem 1rem;
  }

  .about-overlay-content {
    padding: 1rem;
  }

  .about-content > div {
    padding: 0 0.5rem !important;
  }

  .about-content img {
    height: 200px !important;
  }

  .about-content > div > div {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .user-needs-content {
    flex-direction: column !important;
    gap: 2rem !important;
  }

  .user-needs-circle {
    width: 200px !important;
    height: 200px !important;
  }

  .funnel-flow {
    flex-direction: column !important;
  }

  .funnel-stage {
    min-width: 100% !important;
    max-width: 100% !important;
  }

  .flow-comparison {
    flex-direction: column !important;
    gap: 1rem !important;
  }

  .portfolio-tabs {
    flex-wrap: wrap !important;
  }

  .portfolio-details h2 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
  }

  .portfolio-details h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
  }

  .design-image-wrapper .portfolio-image {
    flex-direction: column !important;
    gap: 1.5rem !important;
  }

  .image-group-item {
    width: 100% !important;
  }

  .design-image-wrapper .portfolio-image img {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Increase image size for all Phase 3 sections on mobile */
  #previous-designs-section .design-image-wrapper .portfolio-image .image-group-item img,
  #ui-updates-section .design-image-wrapper .portfolio-image .image-group-item img,
  #design-library-section .design-image-wrapper .portfolio-image .image-group-item img,
  #final-flow-section .final-flow-container .portfolio-image img,
  .phase-section + .design-section .design-image-wrapper .portfolio-image .image-group-item img,
  .phase-section ~ .design-section .final-flow-container .portfolio-image img {
    max-height: 50vh !important;
  }

  .design-image-captions {
    flex-direction: column !important;
  }

  .design-image-captions .design-image-caption {
    max-width: 100% !important;
    width: 100% !important;
  }

  .final-flow-wrapper {
    flex-direction: column !important;
    gap: 1.5rem !important;
  }

  .final-flow-container {
    width: 100% !important;
  }

  .outcomes-section-inline {
    width: 100% !important;
    min-width: 0 !important;
  }

  .outcomes-grid {
    gap: 1rem !important;
  }

  .outcome-metric {
    font-size: 2.5rem !important;
  }

  /* Responsive text sizing for descriptions */
  .portfolio-description {
    font-size: 1rem !important;
    line-height: 1.6 !important;
  }

  .design-description {
    font-size: 1.125rem !important;
    line-height: 1.7 !important;
  }

  .outcomes-description {
    font-size: 1.125rem !important;
    line-height: 1.7 !important;
  }

  .introduction-text p {
    font-size: 1.125rem !important;
    line-height: 1.7 !important;
  }

  .phase-section h3 {
    font-size: 1.75rem !important;
  }

  .phase-section h4 {
    font-size: 1.25rem !important;
  }

  .introduction-text h3 {
    font-size: 1.75rem !important;
  }

  .introduction-text h4 {
    font-size: 1.25rem !important;
  }

  .portfolio-details h2 {
    font-size: 1.5rem !important;
  }

  .portfolio-details h3 {
    font-size: 1.125rem !important;
  }

  /* Ensure text doesn't overflow on mobile */
  .introduction-content {
    flex-direction: column !important;
    gap: 1.5rem !important;
  }

  .introduction-image,
  .introduction-image-billing {
    min-width: auto !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .introduction-image img,
  .introduction-image-billing img {
    width: 100% !important;
    max-width: 100% !important;
  }
}

.email-link-hidden {
  display: none !important;
}
