/* Base styles and typography */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap");

:root {
  --color-bg: #ffffff;
  --color-text: #000000;
  --color-accent: #333333;
  --color-subtle: #666666;
  --spacing-unit: 8px;
  --section-padding: 120px;
  --frame-margin: 40px;
}

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

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: "Proxima Nova", "DM Sans", -apple-system, BlinkMacSystemFont,
    sans-serif;
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--frame-margin);
  position: relative;
  z-index: 0;
}

/* Header */
.header {
  padding: 4rem 2rem;
  text-align: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4rem;
}

.header-image {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.header-image img {
  width: 100%;
  height: auto;
  display: block;
}

h1 {
  font-size: 2.5rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-bottom: calc(var(--spacing-unit) * 2);
}

.subtitle {
  font-size: 1.25rem;
  color: var(--color-subtle);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

h2 {
  font-size: 2.5rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: calc(var(--spacing-unit) * 4);
}

h3 {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-subtle);
  margin-bottom: calc(var(--spacing-unit) * 4);
}

/* Portfolio Sections */
.portfolio-section {
  min-height: 100vh;
  padding: var(--section-padding) 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  margin-bottom: 2rem;
}

/* Special styling for the header section only */
.portfolio-section:first-of-type:not(main .portfolio-section) {
  text-align: center;
  padding: 4rem 2rem;
}

.portfolio-section:first-of-type:not(main .portfolio-section) .section-content {
  padding-top: 0;
  margin-left: 0;
  width: 100%;
}

.portfolio-section:first-of-type:not(main .portfolio-section) .section-header {
  position: relative;
  width: 100%;
  left: 0;
  top: 0;
  text-align: center;
  padding: 0;
}

.portfolio-section:first-of-type:not(main .portfolio-section) .header-image {
  width: 100%;
  max-width: 500px;
  margin: 4rem auto;
}

.portfolio-section:first-of-type:not(main .portfolio-section) .subtitle {
  font-size: 1.25rem;
  color: var(--color-subtle);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.section-header {
  position: fixed;
  top: 100px;
  left: var(--frame-margin);
  width: 300px;
  z-index: 100;
  padding: 2rem;
  text-align: left;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.section-content {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  padding-top: 0;
  margin-left: 350px;
  width: calc(100% - 350px);
}

.portfolio-section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-header.visible {
  opacity: 1;
  transform: translateY(0);
}

.portfolio-section.visible .section-content {
  opacity: 1;
  transform: translateY(0);
}

.portfolio-section img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.portfolio-section img:hover {
  transform: scale(1.02);
}

.portfolio-section h2 {
  margin-bottom: 1rem;
  color: #333;
}

.portfolio-section p {
  line-height: 1.6;
  color: #666;
  margin-bottom: 1.5rem;
}

.portfolio-section::after {
  content: "";
  position: absolute;
  top: var(--frame-margin);
  right: var(--frame-margin);
  bottom: var(--frame-margin);
  left: var(--frame-margin);
  border: 1px solid rgba(0, 0, 0, 0.1);
  pointer-events: none;
  transform: scale(0.98);
  opacity: 0;
  transition: all 0.5s ease;
}

.portfolio-section.visible::after {
  transform: scale(1);
  opacity: 1;
}

.image-container {
  margin: calc(var(--spacing-unit) * 4) 0;
  width: 100%;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  perspective: 1000px;
}

.image-container img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  display: block;
  object-fit: contain;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
  will-change: transform;
}

.image-container:hover img {
  transform: scale(1.02) translateZ(20px);
}

.image-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: calc(var(--spacing-unit) * 3);
  margin: calc(var(--spacing-unit) * 4) 0;
  align-items: start;
  perspective: 1000px;
}

.image-row-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--spacing-unit) * 3);
  margin: calc(var(--spacing-unit) * 4) 0;
  align-items: start;
  perspective: 1000px;
}

.image-row img,
.image-row-3 img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
  will-change: transform;
}

.image-row img:hover,
.image-row-3 img:hover {
  transform: scale(1.02) translateZ(20px);
}

/* Enhanced 3D Hover Effects */
.project-meta,
.project-description {
  transform: translateZ(0);
  transition: transform 0.3s ease;
}

.portfolio-section:hover .project-meta,
.portfolio-section:hover .project-description {
  transform: translateZ(10px);
}

.project-meta {
  color: var(--color-subtle);
  font-size: 0.9rem;
  margin: calc(var(--spacing-unit) * 2) 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.project-description {
  max-width: 800px;
  margin: 0 auto;
  text-align: justify;
  font-size: 1.1rem;
  line-height: 1.8;
}

.video-link {
  margin: calc(var(--spacing-unit) * 6) 0;
  text-align: center;
}

.video-link a {
  color: var(--color-text);
  text-decoration: none;
  padding: calc(var(--spacing-unit) * 2) calc(var(--spacing-unit) * 4);
  border: 1px solid var(--color-text);
  border-radius: 4px;
  transition: all 0.3s ease;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.video-link a:hover {
  background-color: var(--color-text);
  color: var(--color-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox img {
  max-width: 90%;
  max-height: 90vh;
  object-fit: contain;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.lightbox.active img {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-nav {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}

.lightbox-nav button {
  background: none;
  border: 1px solid white;
  color: white;
  padding: 8px 16px;
  cursor: pointer;
  opacity: 0.8;
  transition: all 0.3s ease;
}

.lightbox-nav button:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 1024px) {
  :root {
    --frame-margin: 20px;
    --section-padding: 80px;
  }

  .image-row-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .section-header {
    width: 250px;
  }

  .section-content {
    margin-left: 300px;
    width: calc(100% - 300px);
  }
}

@media (max-width: 768px) {
  :root {
    --frame-margin: 16px;
    --section-padding: 60px;
  }

  .container {
    padding: 0 var(--frame-margin);
  }

  h1 {
    font-size: 2.5rem;
  }

  h2 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1.25rem;
  }

  .header {
    padding: calc(var(--spacing-unit) * 8) 0;
  }

  .image-row,
  .image-row-3 {
    grid-template-columns: 1fr;
    gap: calc(var(--spacing-unit) * 2);
  }

  .project-description {
    font-size: 1rem;
    line-height: 1.6;
  }

  .section-header {
    position: relative;
    width: 100%;
    left: 0;
    top: 0;
    padding: 1rem;
    margin-bottom: 2rem;
  }

  .section-content {
    margin-left: 0;
    width: 100%;
    padding-top: 0;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.header {
  animation: fadeIn 0.8s ease-out forwards;
}

.portfolio-section {
  animation: none;
}

.image-container,
.image-row,
.image-row-3 {
  opacity: 1;
  animation: none;
}

/* Smooth Scrolling */
html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--section-padding);
}

.feature-image {
  margin: 2rem 0 4rem 0;
  width: 100%;
}

.feature-image img {
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  transition: transform 0.3s ease;
}

.feature-image img:hover {
  transform: scale(1.02);
}

.thumbnails-container {
  margin-top: 4rem;
}

.image-container {
  margin: calc(var(--spacing-unit) * 2) 0;
  width: 100%;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  perspective: 1000px;
}

/* Artist Statement Styles */
.title-section {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  margin: 0;
  padding: 0;
  z-index: 2;
  background: var(--color-bg);
}

.title-section.visible {
  opacity: 1;
  visibility: visible;
}

.title-section .statement-text {
  padding: 0;
  opacity: 1;
  transform: none;
}

.title-section h1 {
  font-size: 4rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  margin: 0;
}

.statement-section {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  margin: 0;
  padding: 0;
  pointer-events: none;
  background: var(--color-bg);
}

.statement-section.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 1;
}

/* Create scrollable container that drives the animation */
.container {
  position: relative;
  z-index: 0;
}

/* Add spacer to allow scrolling */
.scroll-spacer {
  height: calc(100vh * 8); /* Adjust based on number of sections */
  position: relative;
  z-index: 0;
}

.statement-text {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
  text-align: center;
}

.statement-text h3 {
  font-size: 3rem;
  font-weight: 500;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  color: var(--color-text);
}

.statement-text p {
  font-size: 1.25rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.statement-section.visible .statement-text h1,
.statement-section.visible .statement-text h3,
.statement-section.visible .statement-text p {
  opacity: 1;
  transform: translateY(0);
}

/* Reset section-content styles for statement page */
.statement-section .section-content {
  opacity: 1;
  transform: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 1200px;
}

@media (max-width: 768px) {
  .title-section h1 {
    font-size: 2.5rem;
  }

  .statement-text h3 {
    font-size: 2rem;
  }

  .statement-text {
    padding: 1rem;
  }
}
