/* ==========================================================================
   CSS Variables (Design Tokens)
   ========================================================================== */

:root {
  /* Colors - Dark Theme with Calm Palette */
  --color-primary: #7c9eff;           /* Calm blue - primary brand color */
  --color-primary-light: #9bb5ff;     /* Light calm blue */
  --color-primary-dark: #5a7fcc;      /* Dark calm blue */
  --color-secondary: #a78bfa;         /* Calm purple - secondary color */
  --color-secondary-light: #c4b5fd;   /* Light calm purple */
  --color-secondary-dark: #8b5cf6;    /* Dark calm purple */
  --color-accent: #34d399;            /* Calm teal - accent color */
  --color-accent-light: #6ee7b7;      /* Light calm teal */
  --color-accent-dark: #10b981;       /* Dark calm teal */
  --color-surface: #0f172a;           /* Deep dark blue - main background */
  --color-surface-variant: #1e293b;   /* Slate dark - alternate background */
  --color-surface-elevated: #334155;   /* Slate - elevated surfaces */
  --color-text-primary: #f1f5f9;      /* Light slate - primary text */
  --color-text-secondary: #cbd5e1;    /* Medium slate - secondary text */
  --color-text-muted: #94a3b8;       /* Muted slate - muted text */
  --color-text-on-primary: #0f172a;   /* Dark text on primary color */
  --color-text-on-secondary: #0f172a; /* Dark text on secondary color */
  --color-background: var(--color-surface);       /* Alias for surface */
  --color-background-alt: var(--color-surface-variant); /* Alias for surface variant */
  --color-border: #334155;            /* Slate - borders */
  --color-border-light: #475569;      /* Light slate */
  --color-border-dark: #1e293b;       /* Dark slate */
  --color-link: #7c9eff;              /* Calm blue - link color */
  --color-link-hover: #9bb5ff;        /* Light calm blue - link hover */
  --color-link-visited: #a78bfa;       /* Calm purple - visited links */

  /* Spacing - 8px Base Unit System */
  --spacing-xs: 0.25rem;   /* 4px */
  --spacing-sm: 0.5rem;    /* 8px */
  --spacing-md: 1rem;      /* 16px */
  --spacing-lg: 2rem;      /* 32px */
  --spacing-xl: 3rem;      /* 48px */
  --spacing-xxl: 4rem;     /* 64px */

  /* Typography */
  --font-family-base: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-base: 1rem;            /* 16px */
  --font-size-sm: 0.875rem;          /* 14px */
  --font-size-lg: 1.125rem;          /* 18px */
  --font-size-xl: 1.25rem;           /* 20px */
  --font-size-2xl: 1.5rem;          /* 24px */
  --font-size-3xl: 2rem;            /* 32px */
  --font-size-4xl: 2.5rem;          /* 40px */
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --line-height-base: 1.6;
  --line-height-heading: 1.2;
  --letter-spacing-tight: -0.025em;
  --letter-spacing-normal: 0;

  /* Layout */
  --container-max-width: 1200px;
  --border-radius: 0.25rem;
  
  /* Material Design Elevation - Dark Theme */
  --elevation-0: none;
  --elevation-1: 0px 1px 2px 0px rgba(0, 0, 0, 0.5), 
                 0px 1px 3px 1px rgba(0, 0, 0, 0.3);
  --elevation-2: 0px 1px 2px 0px rgba(0, 0, 0, 0.5), 
                 0px 2px 6px 2px rgba(0, 0, 0, 0.3);
  --elevation-3: 0px 1px 3px 0px rgba(0, 0, 0, 0.5), 
                 0px 4px 8px 3px rgba(0, 0, 0, 0.3);
  --elevation-4: 0px 2px 3px 0px rgba(0, 0, 0, 0.5), 
                 0px 6px 10px 4px rgba(0, 0, 0, 0.3);
  --elevation-5: 0px 4px 4px 0px rgba(0, 0, 0, 0.5), 
                 0px 8px 12px 6px rgba(0, 0, 0, 0.3);
  
  /* Glow effects for dark theme */
  --glow-primary: 0 0 20px rgba(124, 158, 255, 0.3);
  --glow-secondary: 0 0 20px rgba(167, 139, 250, 0.3);
  --glow-accent: 0 0 20px rgba(52, 211, 153, 0.3);
}

/* ==========================================================================
   Reset / Normalize
   ========================================================================== */

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

/* ==========================================================================
   Base Styles
   ========================================================================== */

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .parallax-bg,
  .parallax-mid,
  .parallax-fg {
    transform: none !important;
    will-change: auto;
  }
}

/* Progressive enhancement: styles when JS is disabled */
.no-js .parallax-bg,
.no-js .parallax-mid,
.no-js .parallax-fg {
  position: static;
  transform: none;
}

body {
  font-family: var(--font-family-base);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text-primary);
  background-color: var(--color-surface);
  min-height: 100vh;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: var(--spacing-md);
  line-height: var(--line-height-heading);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  letter-spacing: var(--letter-spacing-tight);
}

h1 {
  font-size: var(--font-size-4xl);
  margin-bottom: var(--spacing-lg);
}

h2 {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--spacing-md);
}

h3 {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-md);
}

h4 {
  font-size: var(--font-size-xl);
}

h5 {
  font-size: var(--font-size-lg);
}

h6 {
  font-size: var(--font-size-base);
}

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--color-link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

a:focus {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* Lists */
ul, ol {
  margin-left: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

li {
  margin-bottom: var(--spacing-sm);
}

/* ==========================================================================
   Layout
   ========================================================================== */

.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* ==========================================================================
   Components - Header
   ========================================================================== */

header.site-header {
  background-color: transparent;
  border-bottom: 1px solid transparent;
  padding: var(--spacing-md) 0;
  margin-bottom: 0;
  box-shadow: none;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

header.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 158, 255, 0.2), transparent);
  opacity: 0.2;
}

header.site-header.scrolled {
  background-color: rgba(15, 23, 42, 0.7);
  border-bottom-color: var(--color-border);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--elevation-1);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  margin-bottom: 0;
}

.site-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(124, 158, 255, 0.4));
  transition: transform 0.3s ease;
}

.site-logo:hover {
  transform: scale(1.1) rotate(5deg);
}

.site-name {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0;
  color: var(--color-primary);
  letter-spacing: var(--letter-spacing-tight);
  line-height: 1.2;
}

.tagline {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--spacing-sm);
  font-weight: var(--font-weight-normal);
}

/* ==========================================================================
   Components - Navigation
   ========================================================================== */

nav {
  margin-top: var(--spacing-sm);
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-around;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 101;
  gap: 5px;
}

.mobile-menu-toggle:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background-color: var(--color-text-primary);
  border-radius: 2px;
  transition: all 0.3s ease;
  transform-origin: center;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

.nav-list {
  list-style: none;
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-left: 0;
  margin-top: var(--spacing-sm);
}

.nav-list li {
  margin-bottom: 0;
}

.nav-list li a {
  padding: var(--spacing-xs) var(--spacing-sm);
  display: block;
  color: var(--color-text-secondary);
  font-weight: var(--font-weight-medium);
  border-radius: calc(var(--border-radius) * 2);
  transition: all 0.3s ease;
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  font-size: var(--font-size-sm);
}

.nav-list li a:hover {
  color: var(--color-primary-light);
  text-decoration: none;
  background-color: rgba(124, 158, 255, 0.1);
  box-shadow: none;
  transform: translateY(0);
  border-color: rgba(124, 158, 255, 0.3);
}

.nav-list li a.active,
.nav-link.active {
  color: var(--color-primary-light);
  border: 1px solid var(--color-primary);
  text-decoration: none;
  font-weight: var(--font-weight-semibold);
  background-color: rgba(124, 158, 255, 0.15);
  box-shadow: 0 0 10px rgba(124, 158, 255, 0.2);
}

.nav-list li a:focus,
.nav-list li a:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ==========================================================================
   Components - Main Content
   ========================================================================== */

main {
  min-height: 60vh;
  padding: 0;
}

/* Full-page sections */
.section {
  min-height: 100vh;
  padding: var(--spacing-3xl) var(--spacing-lg);
  position: relative;
  overflow: hidden;
}

/* Parallax container */
.parallax-container {
  overflow: hidden;
  position: relative;
}

/* Parallax layers - z-index hierarchy */
.parallax-bg {
  will-change: transform;
  transform: translateZ(0);
  position: absolute;
  z-index: 0;
  pointer-events: none; /* Allow clicks to pass through */
}

/* Parallax mid elements should not be on cards that overlap text */
.parallax-mid {
  will-change: transform;
  transform: translateZ(0);
  position: relative;
  z-index: 1;
}

/* Ensure service cards and portfolio cards are always above parallax backgrounds */
.service-card,
.portfolio-card {
  position: relative;
  z-index: 10; /* Cards should be above parallax backgrounds */
}

.parallax-fg {
  will-change: transform;
  transform: translateZ(0);
  position: relative;
  z-index: 2;
  pointer-events: none; /* Allow clicks to pass through */
}

/* Content should always be above parallax elements */
.section > .container,
.section > .hero-content,
.section > h1,
.section > h2,
.section > p {
  position: relative;
  z-index: 10;
}

main h1 {
  margin-bottom: var(--spacing-lg);
  color: var(--color-primary);
}

main h2 {
  color: var(--color-primary);
  margin-top: var(--spacing-xl);
}

main h3 {
  color: var(--color-text-primary);
}

/* ==========================================================================
   Components - Footer
   ========================================================================== */

footer {
  background-color: transparent;
  border-top: none;
  padding: var(--spacing-xl) 0;
  margin-top: var(--spacing-xxl);
  text-align: center;
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

/* ==========================================================================
   Portfolio Styles
   ========================================================================== */

.portfolio-index {
  padding: var(--spacing-xl) 0;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: var(--spacing-xl);
  margin-bottom: var(--spacing-xl);
  max-width: 1600px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 var(--spacing-lg);
}

.portfolio-card {
  background: rgba(51, 65, 85, 0.3);
  border: none;
  border-radius: 0;
  overflow: hidden;
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  backdrop-filter: blur(10px);
  opacity: 0.95;
}

.portfolio-card__link-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.portfolio-card:hover {
  transform: translateY(-4px);
  opacity: 1;
}

.portfolio-card__image {
  width: 100%;
  height: 280px;
  overflow: hidden;
  background: var(--color-background-alt);
  position: relative;
}

.portfolio-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: brightness(0.85) contrast(1.1);
}

.portfolio-card:hover .portfolio-card__image img {
  filter: brightness(0.95) contrast(1.15);
  transform: scale(1.03);
}

.portfolio-card__content {
  padding: var(--spacing-lg);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 280px;
}

/* Service card content override */
.service-card .service-card__content {
  padding: var(--spacing-xl);
  min-height: auto;
  background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.2) 50%, rgba(15, 23, 42, 0.9) 100%);
}

.portfolio-card__title {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--spacing-md) 0;
  line-height: var(--line-height-heading);
}

.portfolio-card__title {
  color: var(--color-text-primary);
  margin-top: 0;
}

.portfolio-card__link-wrapper:hover .portfolio-card__title {
  color: var(--color-primary-light);
}

.portfolio-card__summary {
  color: var(--color-text-secondary);
  margin: 0 0 var(--spacing-md) 0;
  flex: 1;
}

.portfolio-card__meta {
  margin-bottom: var(--spacing-md);
}

.portfolio-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.tag {
  display: inline-block;
  padding: var(--spacing-xs) var(--spacing-md);
  background: var(--color-background-alt);
  border: 1px solid var(--color-border);
  border-radius: calc(var(--border-radius) * 2);
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
}

.tag--industry {
  background: rgba(124, 158, 255, 0.15);
  border-color: var(--color-primary);
  color: var(--color-primary-light);
}

.tag--service {
  background: rgba(167, 139, 250, 0.15);
  border-color: var(--color-secondary);
  color: var(--color-secondary-light);
}

.portfolio-card__link {
  color: var(--color-link);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
  margin-top: auto;
  display: inline-block;
  transition: all 0.3s ease;
}

.portfolio-card__link-wrapper:hover .portfolio-card__link {
  color: var(--color-primary-light);
  transform: translateX(5px);
}

/* Portfolio Detail Page */
.portfolio-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--spacing-xl) 0;
}

.portfolio-detail__hero {
  margin-bottom: var(--spacing-xl);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.portfolio-detail__hero-image {
  width: 100%;
  height: auto;
  display: block;
}

.portfolio-detail__header {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-lg);
  border-bottom: none;
}

.portfolio-detail__title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-semibold);
  margin: 0 0 var(--spacing-md) 0;
  line-height: var(--line-height-heading);
}

.portfolio-detail__client {
  color: var(--color-text-secondary);
  font-size: var(--font-size-lg);
  margin: 0 0 var(--spacing-sm) 0;
}

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

.portfolio-detail__meta {
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-lg);
  background: rgba(51, 65, 85, 0.3);
  border-radius: 0;
  box-shadow: none;
  border: none;
}

.portfolio-detail__tags {
  margin-bottom: var(--spacing-md);
}

.portfolio-detail__tags:last-child {
  margin-bottom: 0;
}

.portfolio-detail__tags strong {
  display: block;
  margin-bottom: var(--spacing-sm);
  color: var(--color-text-primary);
}

.portfolio-detail__summary {
  margin-bottom: var(--spacing-xl);
  padding: var(--spacing-lg);
  background: rgba(51, 65, 85, 0.3);
  border-left: 4px solid var(--color-primary);
  border-radius: 0;
  box-shadow: none;
}

.portfolio-detail__summary .lead {
  font-size: var(--font-size-lg);
  line-height: var(--line-height-base);
  margin: 0;
  color: var(--color-text-primary);
}

.portfolio-detail__content {
  margin-bottom: var(--spacing-xl);
}

.portfolio-detail__content h2 {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-semibold);
  margin: var(--spacing-xl) 0 var(--spacing-md) 0;
  line-height: var(--line-height-heading);
}

.portfolio-detail__content h3 {
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
  margin: var(--spacing-lg) 0 var(--spacing-md) 0;
  line-height: var(--line-height-heading);
}

.portfolio-detail__content p {
  margin-bottom: var(--spacing-md);
}

.portfolio-detail__content ul,
.portfolio-detail__content ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

.portfolio-detail__content li {
  margin-bottom: var(--spacing-sm);
}

.portfolio-detail__navigation {
  margin-top: var(--spacing-xl);
  padding-top: var(--spacing-lg);
  border-top: none;
}

.portfolio-detail__back-link {
  color: var(--color-link);
  text-decoration: none;
  font-weight: var(--font-weight-medium);
}

.portfolio-detail__back-link:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-xl);
  padding: var(--spacing-lg) 0;
}

.pagination__current {
  color: var(--color-text-secondary);
  font-size: var(--font-size-sm);
}

.pagination__link {
  color: var(--color-link);
  text-decoration: none;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--color-border);
  border-radius: var(--border-radius);
  transition: all 0.2s ease;
  box-shadow: var(--elevation-1);
}

.pagination__link:hover {
  background: var(--color-surface-variant);
  color: var(--color-link-hover);
  box-shadow: var(--elevation-2);
  transform: translateY(-1px);
}

/* ==========================================================================
   Material Design Buttons
   ========================================================================== */

.button {
  display: inline-block;
  padding: var(--spacing-sm) var(--spacing-lg);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-text-on-primary);
  border: 1px solid var(--color-primary);
  border-radius: calc(var(--border-radius) * 2);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--elevation-1), var(--glow-primary);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.button:hover {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  box-shadow: var(--elevation-2), var(--glow-primary);
  transform: translateY(-2px);
  text-decoration: none;
  color: var(--color-text-on-primary);
  border-color: var(--color-primary-light);
}

.button:active {
  box-shadow: var(--elevation-0);
  transform: translateY(1px);
}

.button:focus,
.button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.button--secondary {
  background: var(--color-secondary);
  color: var(--color-text-on-secondary);
}

.button--secondary:hover {
  background: var(--color-secondary-dark);
  color: var(--color-text-on-secondary);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: calc(100vh - 100px);
  max-height: calc(100vh - 100px);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-variant) 100%);
  box-sizing: border-box;
}

.hero-bg {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  background: 
    radial-gradient(circle at 20% 30%, var(--color-primary) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, var(--color-secondary) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, var(--color-accent) 0%, transparent 60%);
  opacity: 0.15;
  z-index: 0;
  transform-origin: center;
  pointer-events: none; /* Allow clicks to pass through */
  filter: blur(60px);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  padding: var(--spacing-sm) var(--spacing-lg);
  flex-shrink: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  gap: 0;
  width: 100%;
}

.hero-title {
  font-size: var(--font-size-4xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  margin-bottom: var(--spacing-md);
  line-height: var(--line-height-heading);
}

.hero-logo {
  margin-bottom: var(--spacing-xs);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 1;
  max-height: 50vh;
  width: 100%;
}

.hero-logo-image {
  max-width: 800px;
  width: 90%;
  height: auto;
  max-height: 400px;
  object-fit: contain;
  filter: drop-shadow(0 4px 20px rgba(124, 158, 255, 0.3));
}

.hero-subtitle {
  font-size: var(--font-size-2xl);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-sm);
  font-weight: var(--font-weight-semibold);
  opacity: 0.95;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.3;
  flex-shrink: 0;
}

.hero-description {
  font-size: var(--font-size-lg);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
  line-height: 1.5;
  opacity: 0.9;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  flex-shrink: 0;
}

.hero-cta {
  font-size: var(--font-size-base);
  padding: var(--spacing-sm) var(--spacing-xl);
  margin-top: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

.hero-illustration {
  position: absolute;
  top: 50%;
  right: 5%;
  transform: translateY(-50%);
  width: 350px;
  height: 350px;
  max-height: 50vh;
  z-index: 1; /* Behind content but above background */
  opacity: 0.3;
  animation: float 6s ease-in-out infinite;
  pointer-events: none; /* Allow clicks to pass through */
  overflow: hidden;
}

.hero-illustration-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: blur(1px);
  opacity: 0.4;
}

@keyframes float {
  0%, 100% {
    transform: translateY(-50%) translateX(0);
  }
  50% {
    transform: translateY(-50%) translateX(20px);
  }
}

.hero-illustration svg {
  width: 100%;
  height: 100%;
}

@media (prefers-reduced-motion: reduce) {
  .hero-illustration {
    animation: none;
  }
}

/* ==========================================================================
   About Section
   ========================================================================== */

.about-section {
  background: var(--color-surface);
}

.two-column-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: calc(var(--spacing-3xl) * 2);
  align-items: start; /* Changed from center to start for better text alignment */
  margin-top: var(--spacing-2xl);
  margin-bottom: var(--spacing-xl);
  position: relative;
}

.two-column-content--reverse {
  direction: rtl;
}

.two-column-content--reverse > * {
  direction: ltr;
}

/* Ensure reverse layout works properly on mobile */
@media (max-width: 768px) {
  .two-column-content--reverse {
    direction: ltr;
  }
}

.column-left {
  padding-top: var(--spacing-lg); /* Add slight top padding to align with image */
  padding-bottom: var(--spacing-lg);
  position: relative;
  z-index: 10; /* Ensure text stays in front of images */
}

.column-right {
  display: flex;
  align-items: flex-start; /* Align image to top */
  justify-content: center;
  padding-top: var(--spacing-lg); /* Match column-left padding */
  padding-bottom: var(--spacing-lg);
  position: relative;
  z-index: 1; /* Images behind text */
}

.column-left .lead {
  font-size: var(--font-size-xl);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
  font-weight: var(--font-weight-medium);
  margin-top: 0; /* Remove top margin to align with image */
}

.column-left p {
  margin-bottom: var(--spacing-md);
}

.column-left h3 {
  font-size: var(--font-size-3xl);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-xl);
  margin-top: 0;
  font-weight: var(--font-weight-semibold);
}

.service-item .column-left p {
  font-size: var(--font-size-lg);
  line-height: 1.8;
  margin-bottom: var(--spacing-lg);
}

.service-item .column-left p:last-of-type {
  margin-bottom: 0;
}

.illustration-card {
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
  width: 100%;
  max-width: 500px;
  margin-top: 0; /* Ensure it starts at the top */
  border: none;
  backdrop-filter: none;
  opacity: 0.6;
  position: relative;
  z-index: 1;
}

.illustration-card:hover {
  transform: translateY(-3px);
  opacity: 0.8;
}

.illustration-card svg,
.illustration-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: calc(var(--border-radius) * 2);
}

.illustration-image {
  object-fit: contain;
  max-height: 500px;
  width: 100%;
  height: auto;
  opacity: 0.5;
  mix-blend-mode: screen;
  filter: blur(1px);
}

/* Smaller images for service items */
.service-item .illustration-card {
  max-width: 450px;
}

.service-item .illustration-image {
  max-height: 450px;
}

/* ==========================================================================
   Services Section
   ========================================================================== */

.services-section {
  position: relative;
  overflow: visible; /* Changed to visible to prevent clipping */
}

.services-bg {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  background: 
    radial-gradient(ellipse at 25% 40%, var(--color-secondary) 0%, transparent 50%),
    radial-gradient(ellipse at 75% 60%, var(--color-accent) 0%, transparent 50%),
    linear-gradient(135deg, var(--color-primary) 0%, transparent 40%);
  opacity: 0.1;
  z-index: 0;
  transform-origin: center;
  pointer-events: none; /* Allow clicks to pass through */
  filter: blur(80px);
}

.services-section .container {
  position: relative;
  z-index: 10;
  background: transparent; /* Ensure container doesn't block parallax bg */
}

.section-intro {
  font-size: var(--font-size-xl);
  color: var(--color-primary-light);
  margin-bottom: var(--spacing-2xl);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  font-weight: var(--font-weight-medium);
  line-height: 1.7;
  opacity: 1;
}

.service-item {
  margin-top: calc(var(--spacing-3xl) * 2);
  margin-bottom: var(--spacing-3xl);
  position: relative;
  z-index: 5; /* Ensure service items are above parallax backgrounds */
}

.service-item:first-of-type {
  margin-top: var(--spacing-3xl);
}

.service-item h3 {
  font-size: var(--font-size-3xl);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-lg);
  font-weight: var(--font-weight-semibold);
}

.service-card {
  position: relative;
  z-index: 10; /* Ensure service cards are above parallax backgrounds */
  min-height: 450px;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: none;
  box-shadow: none;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.5) 100%);
  z-index: 1;
  transition: opacity 0.3s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  opacity: 0.95;
}

.service-card:hover::before {
  opacity: 0.3;
}

.service-card__content {
  position: relative;
  z-index: 2;
  padding: var(--spacing-xl);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.2) 50%, rgba(15, 23, 42, 0.9) 100%);
}

.service-card__content h3 {
  color: var(--color-text-primary);
  font-size: var(--font-size-2xl);
  margin-bottom: var(--spacing-md);
  text-shadow: 0 2px 15px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 0, 0, 0.5);
  font-weight: var(--font-weight-semibold);
}

.service-card__content p {
  color: var(--color-text-secondary);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
  line-height: 1.7;
  font-size: var(--font-size-base);
}

.service-card__icon svg {
  width: 60px;
  height: 60px;
  filter: brightness(0) invert(1); /* Make SVG white */
}

/* ==========================================================================
   Work Section
   ========================================================================== */

.work-section {
  background: var(--color-surface);
}

.portfolio-item {
  margin-top: calc(var(--spacing-3xl) * 2);
  margin-bottom: var(--spacing-3xl);
  position: relative;
  z-index: 5; /* Ensure portfolio items are above parallax backgrounds */
}

.portfolio-item:first-of-type {
  margin-top: var(--spacing-3xl);
}

.portfolio-item h3 {
  font-size: var(--font-size-2xl);
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-md);
  font-weight: var(--font-weight-semibold);
}

.portfolio-item__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-md);
  margin-bottom: var(--spacing-lg);
}

/* ==========================================================================
   Contact Section
   ========================================================================== */

.contact-section {
  position: relative;
}

.contact-bg {
  position: absolute;
  top: -10%;
  left: 0;
  width: 100%;
  height: 120%;
  background: 
    radial-gradient(circle at 40% 30%, var(--color-primary) 0%, transparent 55%),
    radial-gradient(circle at 60% 70%, var(--color-accent) 0%, transparent 55%);
  opacity: 0.08;
  z-index: 0;
  transform-origin: center;
  pointer-events: none; /* Allow clicks to pass through */
  filter: blur(80px);
}

.contact-section .container {
  position: relative;
  z-index: 1;
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-3xl);
  align-items: center;
  margin-top: var(--spacing-xl);
}

.contact-info {
  font-size: var(--font-size-lg);
}

.contact-info p {
  margin-bottom: var(--spacing-md);
}

.contact-info a {
  color: var(--color-link);
  font-weight: var(--font-weight-medium);
}

.contact-illustration {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-xl);
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  border: none;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0.9;
}

.contact-illustration:hover {
  transform: translateY(-3px);
  opacity: 1;
}

.contact-illustration svg,
.contact-image {
  width: 100%;
  max-width: 300px;
  height: auto;
  border-radius: calc(var(--border-radius) * 2);
}

.contact-image {
  object-fit: contain;
}

.cta-section {
  text-align: center;
  margin-top: var(--spacing-2xl);
  padding-top: var(--spacing-xl);
  border-top: none;
}

.cta-section p {
  font-size: var(--font-size-lg);
  margin-bottom: var(--spacing-lg);
  color: var(--color-text-secondary);
}

/* Smooth scroll for anchor links */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Section spacing adjustments */
.section:first-child {
  padding-top: 0; /* Hero section doesn't need top padding */
}

/* Ensure section titles have proper spacing from top */
.section h2 {
  margin-top: 0;
  padding-top: var(--spacing-md);
  scroll-margin-top: 90px; /* Account for sticky header when scrolling */
}

/* Skills page specific styles */
.skills-intro {
  margin-bottom: var(--spacing-3xl);
}

.skills-intro .lead {
  font-size: var(--font-size-xl);
  line-height: 1.7;
  color: var(--color-text-primary);
  max-width: 800px;
}

.section h3 {
  font-size: var(--font-size-2xl);
  color: var(--color-primary-light);
  margin-top: var(--spacing-3xl);
  margin-bottom: var(--spacing-lg);
  font-weight: var(--font-weight-semibold);
}

.section h3:first-of-type {
  margin-top: var(--spacing-2xl);
}

.section p {
  font-size: var(--font-size-lg);
  line-height: 1.7;
  color: var(--color-text-primary);
  margin-bottom: var(--spacing-md);
}

.section strong {
  color: var(--color-primary-light);
  font-weight: var(--font-weight-semibold);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --font-size-4xl: 2rem;      /* 32px */
    --font-size-3xl: 1.75rem;   /* 28px */
    --font-size-2xl: 1.5rem;   /* 24px */
    --font-size-xl: 1.25rem;    /* 20px */
    --font-size-lg: 1.125rem;   /* 18px */
  }

  .container {
    padding: 0 var(--spacing-md);
  }

  header {
    padding: var(--spacing-md) 0;
    margin-bottom: var(--spacing-lg);
  }

  .site-name {
    font-size: var(--font-size-2xl);
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .main-nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    margin-top: 0;
  }

  .main-nav.mobile-nav-open {
    max-height: 500px;
    margin-top: var(--spacing-sm);
  }

  .nav-list {
    flex-direction: column;
    gap: 0;
    width: 100%;
    margin-top: 0;
  }

  .nav-list li {
    width: 100%;
    border-bottom: 1px solid rgba(124, 158, 255, 0.1);
  }

  .nav-list li a {
    padding: var(--spacing-md) var(--spacing-md);
    display: block;
    width: 100%;
    text-align: left;
  }
  
  header.site-header {
    padding: var(--spacing-md) var(--spacing-sm);
  }
  
  .header-brand {
    font-size: var(--font-size-lg);
  }
  
  .header-brand img {
    width: 32px;
    height: 32px;
  }

  main {
    padding: var(--spacing-md) 0;
  }
  
  .container {
    padding: 0 var(--spacing-md);
    max-width: 100%;
  }

  footer {
    padding: var(--spacing-lg) 0;
    margin-top: var(--spacing-xl);
  }

  .hero-section {
    min-height: 70vh;
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .hero-title {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-md);
  }
  
  .hero-logo {
    margin-bottom: var(--spacing-md);
  }
  
  .hero-logo {
    max-height: 35vh;
  }
  
  .hero-logo-image {
    max-width: 90%;
    max-height: 250px;
  }
  
  .hero-subtitle {
    font-size: var(--font-size-xl);
    margin-bottom: var(--spacing-md);
  }
  
  .hero-description {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-lg);
  }
  
  .hero-cta {
    font-size: var(--font-size-base);
    padding: var(--spacing-sm) var(--spacing-lg);
  }

  .hero-subtitle {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-md);
  }
  
  .hero-description {
    font-size: var(--font-size-base);
    margin-bottom: var(--spacing-lg);
  }

  .hero-illustration {
    display: none; /* Hide on mobile */
  }
  
  .hero-cta {
    width: 100%;
    text-align: center;
  }

  .contact-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
  }

  .contact-illustration {
    order: -1; /* Show illustration first on mobile */
    margin-bottom: var(--spacing-lg);
  }
  
  .contact-info {
    font-size: var(--font-size-base);
  }
  
  .contact-info p {
    margin-bottom: var(--spacing-md);
  }
  
  .portfolio-item__tags {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .tag {
    font-size: var(--font-size-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .services-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .two-column-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .two-column-content--reverse {
    direction: ltr;
  }

  .service-item,
  .portfolio-item {
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
  }

  .service-item:first-of-type,
  .portfolio-item:first-of-type {
    margin-top: var(--spacing-xl);
  }
  
  .section {
    padding: var(--spacing-xl) var(--spacing-md);
    min-height: auto;
  }
  
  .section-intro {
    font-size: var(--font-size-lg);
    margin-bottom: var(--spacing-xl);
    text-align: left;
    max-width: 100%;
  }
  
  .section h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-lg);
  }
  
  .two-column-content {
    gap: var(--spacing-xl);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-lg);
    max-width: 100%;
  }

  .portfolio-card__image {
    height: 200px;
  }

  .portfolio-detail__title {
    font-size: var(--font-size-3xl);
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--spacing-lg);
  }
}
