/* Design Tokens */
:root {
  /* Colors - Based on existing timmeko.com */
  --color-primary: #1696d2;        /* Main brand blue */
  --color-secondary: #00B7F4;      /* Accent blue from logo */
  --color-accent: #f59e0b;         /* Adjusted yellow accent - better contrast */
  --color-text: #1e293b;
  --color-text-light: #64748b;
  --color-background: #ffffff;
  --color-surface: #f8fafc;
  --color-border: #e2e8f0;
  
  /* Typography - Consolidated to Inter */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-secondary: "Droid Serif", Georgia, "Times New Roman", serif;
  
  /* Spacing - Tightened up */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.25rem;
  --space-xl: 2rem;
  --space-2xl: 2.5rem;
  
  /* Layout */
  --container-max: 1000px;
  --border-radius: 0px;
  --border-radius-lg: 0px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  line-height: 1.5; /* Tighter line height */
  color: var(--color-text);
  background-color: var(--color-background);
  margin: 0;
  padding: 0; /* Remove top padding - nav will be scroll-triggered */
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-md);
  background: transparent; /* Ensure containers have no background */
}

/* Typography - Tighter hierarchy */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-secondary);
  font-style: italic;
  line-height: 1.2; /* Tighter line height */
  margin-bottom: var(--space-sm); /* Much less space below headings */
  color: var(--color-text);
  background: transparent;
}

h1 { font-size: 2rem; } /* Smaller */
h2 { font-size: 1.75rem; } /* Increased from 1.5rem */
h3 { font-size: 1.25rem; } /* Decreased from 1.75rem for featured titles */

p {
  margin-bottom: var(--space-sm); /* Tighter paragraph spacing */
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Header - Always visible sticky nav */
header {
  padding: var(--space-md) 0; /* Reduced padding */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: 1000;
  transition: all 0.3s ease;
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

header.scrolled {
  padding: var(--space-sm) 0;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

header.scrolled .logo svg {
  width: 200px;
}

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



.logo svg {
  display: block;
  transition: all 0.3s ease;
}

.logo:hover svg {
  text-decoration: none;
}

.logo:hover .title-name {
  fill: var(--color-accent); /* Yellow on hover */
}

/* Navigation - more compact */
.main-nav {
  display: flex;
  gap: var(--space-md); /* Reduced gap */
  align-items: center;
}

.main-nav a {
  font-family: var(--font-primary);
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  padding: var(--space-xs); /* Smaller padding */
  transition: all 0.2s ease;
  font-size: 0.9rem; /* Slightly smaller */
}

.main-nav a:hover {
  color: var(--color-primary);
  background: var(--color-surface);
  text-decoration: none;
}

.main-nav a:active {
  color: var(--color-accent);
  background: var(--color-surface);
}

/* Main Content */
main {
  min-height: 60vh;
  padding: calc(var(--space-md) * 4) 0 var(--space-xl) 0; /* Add top padding for fixed nav */
}

/* Page Styles */
.page {
  padding-top: 0; /* Remove any additional padding since main handles it */
}

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

.page-content {
  max-width: 800px;
  margin: 0 auto;
}

/* Page content images */
.page-content img {
  max-width: 100%;
  height: auto;
  margin: var(--space-md) 0;
  box-shadow: var(--shadow-sm);
}

/* Multiple images in sequence */
.page-content img + img {
  margin-top: var(--space-sm);
}

/* Ensure sections don't get hidden under fixed header */
.featured.section,
.insights.section,
.editing.section,
.index.section,
.about-contact.section {
  scroll-margin-top: 100px; /* Increased for always-visible header */
}

/* Section Styles - Much tighter */
.section {
  margin-bottom: var(--space-xl); /* Reduced from 2xl */
  background: transparent;
  scroll-margin-top: 80px; /* Adjust for when header appears */
  position: relative !important;
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
  margin-top: var(--space-2xl); /* Add significant top margin to separate sections */
  background: transparent;
  color: var(--color-text);
  padding-top: 0;
  position: relative;
  z-index: 1;
  display: block;
  visibility: visible;
}

.section-header h2 {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important; /* Force opacity to 1 */
  color: var(--color-text, #1e293b) !important;
  font-size: 1.75rem !important;
  font-family: var(--font-secondary, Georgia, serif) !important;
  font-style: italic !important;
  margin: 0 0 var(--space-sm, 0.5rem) 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
}

/* First section after hero doesn't need extra top margin */
.featured.section .section-header {
  margin-top: var(--space-xl); /* Smaller top margin for first section after hero */
}

/* Specific section header positioning fixes */
#featured .section-header,
#insights .section-header,
#editing .section-header,
#more-work .section-header,
#about-contact .section-header {
  position: static !important;
  display: block !important;
  margin-top: var(--space-2xl) !important;
  margin-bottom: var(--space-lg) !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding: 0 !important;
  transform: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: auto !important;
}

#featured .section-header {
  margin-top: var(--space-xl) !important; /* First section gets less space */
}

/* Override any potential conflicting opacity rules */
.section-header,
.section-header *,
header.section-header,
h2.section-header {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Reset any inherited positioning or transform issues */
.section-header {
  position: relative !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  float: none !important;
  clear: both !important;
}

.section-header h2 {
  position: relative !important;
  transform: none !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  float: none !important;
  clear: both !important;
}

/* Card Styles - Editing section (2 cols mobile → 4 cols desktop)
   Hierarchy: Featured (2 cols) > Editing (4 cols) > More (5 cols) */
.cards-grid {
  display: grid;
  gap: var(--space-xs); /* Much tighter gap */
  grid-template-columns: repeat(2, 1fr); /* Mobile: 2x2 */
  margin-bottom: var(--space-lg); /* Reduced */
  width: 100%;
}

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

.card:hover {
  transform: translateY(-1px); /* Subtle movement */
  box-shadow: var(--shadow-md);
}

.card-image {
  width: 100%;
  aspect-ratio: 3/2;
  object-fit: cover;
  flex-shrink: 0;
}

.card-content {
  padding: var(--space-xs); /* Much tighter */
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 0.875rem;
  margin-bottom: 0;
  line-height: 1.3;
  color: inherit; /* Use inherited color */
  font-family: var(--font-secondary); /* Match featured work styling */
  font-style: italic; /* Match featured work styling */
}

/* Hero Section - With scrolling background */
.hero {
  text-align: center;
  padding: 0;
  position: relative;
  overflow: hidden;
  margin-top: 0; /* Remove margin since nav is persistent */
  height: 100vh; /* Exact viewport height */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero Section - Traditional variant */
.hero-traditional {
  text-align: center;
  padding: var(--space-2xl) 0;
  margin-top: 0; /* Remove margin since nav is persistent */
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-traditional .container {
  max-width: 600px;
}

.hero-traditional h1 {
  font-family: var(--font-secondary);
  font-style: italic;
  font-size: 3rem;
  margin-top: 0;
  margin-bottom: var(--space-md);
  color: var(--color-text);
  font-weight: 400;
}

.hero-traditional .hero-statement {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 1.125rem;
  color: var(--color-text-light);
  margin: 0;
  line-height: 1.5;
}

/* Hero background container */
.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Scrolling grid container */
.scrolling-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Individual scroll rows - tight with no gaps, extended for full coverage */
.scroll-row {
  display: flex;
  white-space: nowrap;
  height: 25vh; /* Exactly 25% of viewport height */
  align-items: center;
  gap: 0; /* No gaps between images */
  overflow: hidden;
  margin: 0; /* No vertical margins */
  min-width: 300vw; /* Ensure content extends well beyond viewport */
}

/* Different scroll directions and speeds */
.scroll-row--1 {
  animation: scroll-left 120s linear infinite;
}

.scroll-row--2 {
  animation: scroll-right 100s linear infinite;
}

.scroll-row--3 {
  animation: scroll-left 140s linear infinite;
}

.scroll-row--4 {
  animation: scroll-right 110s linear infinite;
}

/* Mobile-only additional rows */
.scroll-row--5 {
  animation: scroll-left 130s linear infinite;
}

.scroll-row--6 {
  animation: scroll-right 90s linear infinite;
}

/* Hide mobile rows on desktop */
.mobile-only {
  display: none;
}

/* Scroll animations - Updated for 8x repetitions */
@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-12.5%); /* Move by 1/8 since we have 8x content */
  }
}

@keyframes scroll-right {
  0% {
    transform: translateX(-12.5%);
  }
  100% {
    transform: translateX(0);
  }
}

/* Individual image tiles - tight squares */
.scroll-tile {
  flex: 0 0 auto;
  width: 25vh; /* Square tiles based on row height */
  height: 25vh;
  margin: 0; /* No margins */
}

.scroll-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0; /* No border radius for tight grid */
  display: block; /* Remove inline spacing */
}

/* Semi-transparent overlay for text readability */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2); /* Reduced from 0.85 for more vibrant images */
  z-index: 2;
}

/* Hero content over the background - perfectly centered */
.hero .container {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.hero .hero-content {
  background: rgba(255, 255, 255, 0.95);
  padding: var(--space-xl);
  border-radius: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  margin: 0;
}

.hero h1 {
  font-family: var(--font-secondary);
  font-style: italic;
  font-size: 3rem;
  margin-top: 0px;
  margin-bottom: var(--space-md);
  color: var(--color-text);
  font-weight: 400;
}

.hero-statement {
  font-family: var(--font-primary);
  font-weight: 400;
  font-size: 1.125rem;
  color: var(--color-text-light);
  margin: 0;
  line-height: 1.5;
}

/* Card metadata */
.card-date {
  font-size: 0.875rem;
  color: var(--color-text-light);
  display: block;
  margin-bottom: var(--space-xs);
}

.card-type {
  font-size: 0.875rem;
  color: var(--color-accent);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.card-title a {
  color: inherit;
  text-decoration: none;
}

.card-title a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

/* Image placeholders */
.card-image,
.featured-card .card-image,
.more-image {
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: 0.875rem;
  text-align: center;
  position: relative;
}

.card-image::before,
.featured-card .card-image::before,
.more-image::before {
  content: "Image needed";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 0.75rem;
  color: var(--color-text-light);
  background: rgba(255, 255, 255, 0.9);
  padding: var(--space-xs);
  border-radius: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card:hover .card-image::before,
.featured-card:hover .card-image::before,
.more-card:hover .more-image::before {
  opacity: 1;
}

/* Hide placeholder text when real image is present */
img.card-image::before,
img.more-image::before {
  display: none;
}

/* About section - more compact */
.about-content {
  display: grid;
  gap: var(--space-lg); /* Reduced gap */
  align-items: center;
  max-width: 700px; /* Narrower */
  margin: 0 auto;
  grid-template-columns: 1fr;
}

.about-text p {
  font-size: 1rem; /* Smaller */
  margin-bottom: var(--space-sm); /* Tighter */
  line-height: 1.5;
  text-align: left;
}

.about-links {
  margin-top: var(--space-lg);
}

.about-link {
  display: inline-flex;
  align-items: center;
  background: var(--color-primary);
  color: white;
  padding: var(--space-sm) var(--space-lg);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease;
}

.about-link:hover {
  background: var(--color-secondary);
  text-decoration: none;
}

.about-photo {
  text-align: center;
}

.headshot {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border: 3px solid var(--color-border);
  transition: transform 0.3s ease;
}

.headshot:hover {
  transform: scale(1.05);
}

.headshot-placeholder {
  width: 200px;
  height: 200px;
  background: var(--color-surface);
  border: 3px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
  font-size: 0.875rem;
  transition: transform 0.3s ease;
}

.headshot-placeholder:hover {
  transform: scale(1.05);
}

/* Featured Section - Side-by-side alternating layout */
.featured-list {
  max-width: 1000px;
  margin: 0 auto;
}

.featured-project {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  margin-bottom: 100px;
  padding: 40px;
  border-radius: 0;
  /* Remove initial opacity/transform that might affect layout */
  opacity: 1;
  transform: translateY(0);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
  position: relative;
}

/* Animation trigger - only apply transform/opacity when specifically animating in */
.featured-project:not(.animate-in) {
  opacity: 0;
  transform: translateY(60px);
}

.featured-project.animate-in {
  opacity: 1;
  transform: translateY(0);
}

/* Reverse layout for alternating alignment */
.featured-project--reverse {
  grid-template-columns: 1fr 1fr;
}

.featured-project--reverse .featured-project__media {
  order: 2;
}

.featured-project--reverse .featured-project__content {
  order: 1;
}

/* Media container */
.featured-project__media {
  position: relative;
}

.featured-project__media-link {
  display: block;
  text-decoration: none;
}

.featured-project__video {
  width: 100%;
  height: auto;
  aspect-ratio: 1.5/1;
  object-fit: cover;
  border: 1px solid var(--color-border);
}

/* Content container */
.featured-project__content {
  padding: 20px;
}

.featured-project__content-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.featured-project__content-link:hover {
  text-decoration: none;
}

.featured-project__title {
  font-family: var(--font-secondary);
  font-style: italic;
  font-size: 1.5rem;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--color-text);
}

.featured-project__description {
  font-family: var(--font-primary);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text);
  margin: 0;
}

/* Hover effects */
.featured-project:hover {
  background-color: #fafafa;
}

.featured-project__content-link:hover .featured-project__title {
  color: var(--color-primary);
}

/* Dark mode hover */
body.dark-mode .featured-project:hover {
  background-color: #1f1f1f;
}

/* Insights Section - Tighter list format */
.insights-list {
  max-width: 700px; /* Narrower */
  margin: 0 auto;
}

.insight-item {
  padding: var(--space-sm) 0; /* Tighter padding */
  border-bottom: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.insight-item:last-child {
  border-bottom: none;
}

.insight-title {
  margin: 0;
  font-size: 1rem; /* Smaller */
  font-weight: 600;
  font-family: var(--font-primary);
}

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

.insight-title a:hover {
  color: var(--color-primary);
}

/* Insights metadata styling */
.insight-meta {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  flex-wrap: wrap;
}

.insight-type {
  font-size: 0.875rem;
  color: var(--color-primary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.insight-date {
  font-size: 0.875rem;
  color: var(--color-text-light);
}

/* Card link styling */
.card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.card-link:hover .card-title {
  color: var(--color-primary);
}

/* Index/More Projects Grid - Tighter thumbnails */
.index-grid {
  display: grid;
  gap: var(--space-xs); /* Much tighter gap */
  grid-template-columns: repeat(2, 1fr); /* Mobile: 2 across */
  margin-bottom: var(--space-lg); /* Reduced */
  width: 100%;
}

.index-card {
  position: relative;
  aspect-ratio: 4/3; /* Uniform 4:3 ratio */
  overflow: hidden;
  background: var(--color-surface);
  cursor: pointer;
  border: 1px solid var(--color-border);
  transition: transform 0.2s ease;
}

.index-card:hover {
  transform: translateY(-1px); /* Subtle movement */
  box-shadow: var(--shadow-md);
}

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

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

/* Index card overlay */
.index-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: var(--space-md) var(--space-sm) var(--space-sm);
  opacity: 0;
  transform: translateY(100%);
  transition: all 0.3s ease;
  z-index: 10;
}

.index-card:hover .index-overlay {
  opacity: 1;
  transform: translateY(0);
}

.index-title {
  font-size: 0.8rem; /* Smaller */
  font-weight: 500; /* Less bold */
  line-height: 1.2;
}

.index-link {
  position: absolute;
  inset: 0;
  z-index: 20;
}

/* Load More Button - more compact */
.load-more-container {
  text-align: center;
  margin-top: var(--space-md); /* Reduced */
}

.load-more-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: var(--space-xs) var(--space-md); /* Smaller button */
  font-size: 0.9rem; /* Smaller text */
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.load-more-btn:hover {
  background: var(--color-secondary);
}

.load-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Hide items initially for lazy loading - show first 25 */
.index-card[data-index]:nth-child(n+26) {
  display: none;
}

/* Modal styles */
.more-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  padding: var(--space-lg);
}

.more-modal.active {
  opacity: 1;
  visibility: visible;
}

.more-modal-content {
  background: white;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.more-modal.active .more-modal-content {
  transform: scale(1);
}

.more-modal-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  font-size: 1.2rem;
  line-height: 1;
}

.more-modal-close:hover {
  background: rgba(0, 0, 0, 0.7);
}

.more-modal-image {
  width: 100%;
  max-height: 60vh;
  object-fit: cover;
}

.more-modal-body {
  padding: var(--space-lg);
}

.more-modal-title {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
  font-family: var(--font-secondary);
  font-style: italic;
}

.more-modal-date {
  color: var(--color-text-light);
  font-size: 0.875rem;
  margin-bottom: var(--space-md);
}

.more-modal-summary {
  margin-bottom: var(--space-lg);
  line-height: 1.6;
}

.more-modal-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: var(--color-primary);
  color: white;
  padding: var(--space-sm) var(--space-lg);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s ease;
}

.more-modal-link:hover {
  background: var(--color-secondary);
  text-decoration: none;
}

.more-modal-link::after {
  content: '→';
  font-size: 1.2rem;
}

/* Modal responsive styles */
@media (max-width: 768px) {
  .more-modal {
    padding: var(--space-md);
  }
  
  .more-modal-content {
    max-height: 95vh;
  }
  
  .more-modal-body {
    padding: var(--space-md);
  }
  
  .more-modal-title {
    font-size: 1.25rem;
  }
}

/* Footer - more compact */
footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: var(--space-lg) 0; /* Reduced padding */
  margin-top: var(--space-xl); /* Reduced margin */
}

.social-links {
  text-align: center;
}

.social-links a {
  margin: 0 var(--space-md);
  color: var(--color-text-light);
  font-weight: 500;
}

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

/* Responsive Design */
@media (min-width: 640px) {
  .container {
    padding: 0 var(--space-lg);
  }
}

@media (min-width: 768px) {
  /* Editing: 4 tiles across on desktop */
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* Index grid: 4 across on tablet/desktop */
  .index-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  /* About section: side-by-side layout */
  .about-content {
    grid-template-columns: 2fr 1fr;
    text-align: left;
  }
  
  .about-photo {
    text-align: right;
  }
}

@media (max-width: 767px) {
  /* Featured projects: stack on mobile */
  .featured-project {
    grid-template-columns: 1fr;
    gap: 30px;
    margin-bottom: 60px;
    padding: 20px;
  }
  
  .featured-project--reverse .featured-project__media,
  .featured-project--reverse .featured-project__content {
    order: initial;
  }
  
  .featured-project__content {
    padding: 0;
  }
  
  .featured-project__title {
    font-size: 1.25rem;
  }
  
  .featured-project__description {
    font-size: 1rem;
  }
}

@media (min-width: 1024px) {
  /* Index grid: 5 across on larger screens */
  .index-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* Mobile Hamburger Navigation */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  z-index: 1001;
  position: relative;
}

/* Hamburger icon styling */
.hamburger-lines {
  display: block;
  width: 24px;
  height: 18px;
  position: relative;
}

.hamburger-lines span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--color-text);
  border-radius: 0;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger-lines span:nth-child(1) {
  top: 0;
}

.hamburger-lines span:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
}

.hamburger-lines span:nth-child(3) {
  bottom: 0;
}

/* Hamburger animation when open */
.mobile-nav-toggle.active .hamburger-lines span:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.mobile-nav-toggle.active .hamburger-lines span:nth-child(2) {
  opacity: 0;
}

.mobile-nav-toggle.active .hamburger-lines span:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

@media (max-width: 640px) {
  .hero {
    height: 100vh; /* Full viewport height on mobile */
    padding: 0;
  }
  
  .hero .container {
    padding: 0 var(--space-md);
  }
  
  .hero .hero-content {
    padding: var(--space-lg);
    margin: 0;
    width:90vw;
  }
  
  .hero h1 {
    font-size: 2.25rem;
    margin-top: 0px;
  }
  
  .hero-statement {
    font-size: 1rem;
  }
  
  /* Show mobile-only rows for better vertical coverage */
  .mobile-only {
    display: flex;
  }
  
  /* Adjust row heights for 6 rows on mobile */
  .scroll-row {
    height: 16.67vh; /* 6 rows = 16.67vh each */
    gap: 0;
  }
  
  /* Square tiles matching row height exactly */
  .scroll-tile {
    width: 16.67vh; /* Always match row height for perfect squares */
    height: 16.67vh;
    margin: 0;
  }
  
  /* Mobile Navigation */
  .mobile-nav-toggle {
    display: block;
  }
  
  .main-nav {
    position: fixed;
    top: 0;
    left: -100%;
    width: 280px;
    height: 100vh;
    background: var(--color-background);
    border-right: 1px solid var(--color-border);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 0;
    padding: 80px var(--space-lg) var(--space-lg);
    transition: left 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  }
  
  .main-nav.mobile-nav-open {
    left: 0;
  }
  
  .main-nav a {
    font-size: 1.1rem;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    font-weight: 500;
    background: none;
    transition: all 0.2s ease;
  }
  
  .main-nav a:hover {
    background: var(--color-surface);
    color: var(--color-primary);
    padding-left: var(--space-sm);
  }
  
  .main-nav a:last-child {
    border-bottom: none;
  }
  
  /* Mobile nav overlay */
  .mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
  }
  
  .mobile-nav-overlay.mobile-nav-open {
    opacity: 1;
    visibility: visible;
  }
  
  /* Logo adjustments */
  .logo svg {
    width: 240px;
  }
  
  header.scrolled .logo svg {
    width: 200px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
    margin-top: 0px;
  }
  
  .hero .hero-content {
    padding: var(--space-md);
    margin: 0;
  }
  
  .hero .container {
    padding: 0 var(--space-sm);
  }
  
  /* Keep square tiles matching row height exactly */
  .scroll-tile {
    width: 16.67vh; /* ALWAYS match row height for perfect squares */
    height: 16.67vh;
    margin: 0;
  }
  
  .scroll-row {
    height: 16.67vh; /* Maintain 6-row structure */
    gap: 0;
  }
  
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.125rem; }
  
  /* Logo size adjustment for very small screens */
  .logo svg {
    width: 200px;
  }
  
  header.scrolled .logo svg {
    width: 180px;
  }
}

/* Pull Quote Styles */
blockquote {
  font-family: var(--font-secondary);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--color-text);
  border-left: 4px solid var(--color-primary);
  margin: var(--space-xl) 0;
  line-height: 1.4;
  background: var(--color-surface);
  padding: var(--space-lg);
}

.pull-quote {
  font-family: var(--font-secondary);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--color-text);
  text-align: center;
  margin: var(--space-xl) 0;
  padding: var(--space-lg);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  line-height: 1.3;
}

/* Page content videos */
.page-content video {
  max-width: 100%;
  height: auto;
  margin: var(--space-md) 0;
  box-shadow: var(--shadow-sm);
}

/* Responsive video containers */
@media (max-width: 768px) {
  .page-content video {
    width: 100% !important;
    height: auto !important;
  }
}

/* Video Embed Styles */
.video-embed {
  margin: var(--space-lg) 0;
  position: relative;
  width: 100%;
}

.video-embed iframe,
.video-embed video {
  width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.video-embed video {
  background: var(--color-surface);
}

.video-caption {
  font-size: 0.875rem;
  color: var(--color-text-light);
  text-align: center;
  font-style: italic;
  margin-top: var(--space-sm);
  margin-bottom: 0;
}

/* Responsive video embeds */
@media (max-width: 768px) {
  .video-embed iframe,
  .video-embed video {
    width: 100% !important;
    height: auto !important;
  }
}



/* Dark Mode Styles */
body.dark-mode {
  --color-text: #f1f5f9;
  --color-text-light: #94a3b8;
  --color-background: #111111; /* True dark gray */
  --color-surface: #1a1a1a; /* Slightly lighter dark gray */
  --color-border: #333333; /* Dark gray border */
}



body.dark-mode header {
  background: rgba(17, 17, 17, 0.98); /* Match new dark background */
  backdrop-filter: blur(10px);
  border-bottom-color: var(--color-border);
}

body.dark-mode header.scrolled {
  background: rgba(17, 17, 17, 0.98); /* Match new dark background */
  backdrop-filter: blur(10px);
  border-bottom-color: var(--color-border);
}

/* Dark mode logo color corrections */
body.dark-mode .logo svg polygon {
  fill: #ffffff !important; /* White background in dark mode */
}

body.dark-mode .logo svg .title-name {
  fill: #000000 !important; /* Black text in dark mode */
}

/* Dark mode hero styles */
body.dark-mode .hero-overlay {
  background: rgba(17, 17, 17, 0.6); /* Reduced from 0.85 for more vibrant images */
}

body.dark-mode .hero .hero-content {
  background: rgba(17, 17, 17, 0.95);
  color: var(--color-text);
}

body.dark-mode .hero-statement {
  color: var(--color-text-light);
}

body.dark-mode .index-overlay {
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

/* Better dark mode support */
body, h1, h2, h3, h4, h5, h6, .section-header, .main-nav a, .hero-statement {
  transition: color 0.3s ease, background-color 0.3s ease;
}

.card, .index-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Additional dark mode styles for complete coverage */
body.dark-mode .card-image,
body.dark-mode img.featured-image,
body.dark-mode .index-image {
  background: var(--color-surface);
}

body.dark-mode .headshot-placeholder {
  background: var(--color-surface);
  border-color: var(--color-border);
}

body.dark-mode footer {
  background: var(--color-surface);
  border-top-color: var(--color-border);
}

body.dark-mode .about-link {
  background: var(--color-primary);
}

body.dark-mode .about-link:hover {
  background: var(--color-secondary);
}

body.dark-mode .load-more-btn {
  background: var(--color-primary);
}

body.dark-mode .load-more-btn:hover {
  background: var(--color-secondary);
}

body.dark-mode .more-modal-content {
  background: var(--color-background);
  color: var(--color-text);
}

body.dark-mode .more-modal-link {
  background: var(--color-primary);
}

body.dark-mode .more-modal-link:hover {
  background: var(--color-secondary);
}

body.dark-mode blockquote {
  background: var(--color-surface);
  border-left-color: var(--color-primary);
}

body.dark-mode .pull-quote {
  border-top-color: var(--color-border);
  border-bottom-color: var(--color-border);
}

/* Dark mode hamburger icon */
body.dark-mode .hamburger-lines span {
  background: var(--color-text);
}

body.dark-mode .main-nav {
  background: var(--color-background);
  border-right-color: var(--color-border);
}