/*
 * Portfolio Stylesheet
 * Clean, minimal design with generous whitespace
 */

/* CSS Variables for theming */
:root {
  /* Light mode colors */
  --color-bg: #ffffff;
  --color-text: #1a1a1a;
  --color-text-secondary: #555555;
  --color-accent: #0066cc;
  --color-border: #e0e0e0;
}

/* Dark mode colors */
@media (prefers-color-scheme: dark) {
  :root {
    --color-bg: #1a1a1a;
    --color-text: #f5f5f5;
    --color-text-secondary: #b0b0b0;
    --color-accent: #4a9eff;
    --color-border: #333333;
  }
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Page fade-in overlay */
#fadein {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-bg);
  z-index: 9999;
  pointer-events: none;
  transition: opacity 1s ease;
}

/* Typography */
h1 {
  font-size: 72px;
  font-weight: 600;
  line-height: 1.1;
  margin-bottom: 40px;
  letter-spacing: -0.02em;
}

h2 {
  font-size: 48px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

h3 {
  font-size: 32px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 12px;
}

p {
  margin-bottom: 16px;
  color: var(--color-text-secondary);
}

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

a:hover {
  opacity: 1;
}

/* Layout */
main {
  max-width: 800px;
  margin: 0 auto;
  padding: 200px 40px 280px 40px;
  position: relative;
}

/* Project detail pages - reduce padding */
main.project-detail {
  padding-top: 80px;
  padding-bottom: 20px;
}

section {
  margin-bottom: 160px;
}

/* Hero Section */
.hero {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Footer flourish */
.footer-flourish {
  font-size: 14px;
  line-height: 1.6;
  font-weight: 500;
  color: var(--color-text);
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 1px;
  transition: border-bottom-color 0.2s ease;
}

.footer-flourish:hover {
  border-bottom-color: var(--color-text);
}

.intro {
  font-size: 24px;
  line-height: 1.5;
  max-width: 800px;
  color: var(--color-text-secondary);
  margin-bottom: 40px;
}

.contact-link {
  font-size: 24px;
  line-height: 1.5;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: border-color 0.2s ease;
  font-weight: 500;
}

.contact-link:hover {
  border-bottom-color: var(--color-text);
}

/* Project Sections */
.project {
  position: relative;
}

.project-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s ease;
}

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

.project h2 {
  margin-bottom: 8px;
  border-bottom: 4px solid transparent;
  display: inline-block;
  transition: border-color 0.2s ease;
}

/* Show underline when hovering over title link or image link */
.project:has(a.project-link:hover) h2 {
  border-bottom-color: var(--color-text);
}

.project p {
  font-size: 20px;
  line-height: 1.6;
  max-width: 800px;
  margin-bottom: 40px;
}

/* Grid halftone canvas containers - full width up to 1728px (MacBook Pro 16") */
.project-image-container {
  width: 100vw;
  max-width: 1728px;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 8px;
  overflow: hidden;
}

.stipple-canvas {
  width: 100%;
  aspect-ratio: 8 / 3;
  display: block;
}

/* Project details - two column layout (25% / 75%) */
.project-details {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 60px;
  margin-top: 0;
}

.detail-col p {
  font-size: 16px;
  line-height: 1.6;
  margin-bottom: 0;
}

.detail-date p,
.detail-description p {
  color: var(--color-text-secondary);
}

/* Placeholder for images */
.project-image-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 24px;
  margin: 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.project-image-placeholder.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Images & Videos */
img,
video {
  width: 100%;
  height: auto;
  border-radius: 24px;
  margin: 36px 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

img.is-visible,
video.is-visible {
  opacity: 1;
  transform: translateY(0);
}


/* Project detail pages - add padding to text content (desktop only) */
@media (min-width: 769px) {
  .project-detail h2,
  .project-detail h3,
  .project-detail section,
  .project-detail .project-navigation {
    padding-left: 40px;
    padding-right: 40px;
  }
}

/* Project detail page - specific h2 styling */
.project-detail h2 {
  margin-bottom: 24px;
}

/* Project detail page sections */
.project-detail section {
  margin-bottom: 0;
  color: var(--color-text-secondary);
}

/* Style first section like intro on index */
.project-detail section:first-of-type {
  font-size: 24px;
  line-height: 1.5;
}

.project-detail h3 {
  margin-top: 80px;
  margin-bottom: 24px;
}

/* Default image placeholder styling - no margins by default */
.project-detail .project-image-placeholder {
  margin: 0;
}

/* Experiments page - spacing between consecutive images (80px total) */
.project-detail .project-image-placeholder + .project-image-placeholder {
  margin-top: 80px;
}

/* First image after intro section on Experiments page (80px total from intro) */
.project-detail section:first-of-type + .project-image-placeholder {
  margin-top: 80px;
}

/* Experiments page - intro to first video/image spacing */
.project-detail section:first-of-type + video,
.project-detail section:first-of-type + img {
  margin-top: 72px;
}

/* Project navigation at bottom */
.project-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 80px;
  margin-bottom: 48px;
}

.nav-link {
  font-size: 18px;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: border-color 0.2s ease;
  font-weight: 500;
}

.nav-link:hover {
  border-bottom-color: var(--color-text);
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    font-size: 16px;
  }

  main {
    padding: 200px 24px 280px 24px;
  }

  /* Project detail pages - reduce padding on mobile */
  main.project-detail {
    padding-top: 80px;
    padding-bottom: 20px;
  }

  /* Footer flourish mobile font size */
  .footer-flourish {
    font-size: 12px;
  }

  section {
    margin-bottom: 120px;
  }

  /* Keep project detail section spacing consistent on mobile */
  .project-detail section {
    margin-bottom: 0;
  }


  h1 {
    font-size: 48px;
  }

  h2 {
    font-size: 36px;
  }

  h3 {
    font-size: 24px;
  }

  .intro {
    font-size: 20px;
  }

  .contact-link {
    font-size: 20px;
  }

  /* Project detail intro should match index intro on mobile */
  .project-detail section:first-of-type {
    font-size: 20px;
  }

  .project p {
    font-size: 18px;
  }

  .detail-col p {
    font-size: 14px;
  }

  /* Stack two-column layout on mobile */
  .project-details {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .detail-date p {
    margin-bottom: 4px;
  }

  .hero {
    min-height: 50vh;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 36px;
  }

  h2 {
    font-size: 28px;
  }

  main {
    padding: 200px 20px 280px 20px;
  }

  /* Project detail pages - reduce padding on smaller mobile */
  main.project-detail {
    padding-top: 80px;
    padding-bottom: 20px;
  }

  section {
    margin-bottom: 80px;
  }

  /* Keep project detail section spacing consistent on smaller mobile */
  .project-detail section {
    margin-bottom: 0;
  }

}
