/* ========================================
   Peter Zeitz Portfolio - Main Styles
   ======================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: #fff;
  color: #1a1a1a;
  line-height: 1.6;
}

a, button {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========================================
   Fonts
   ======================================== */

@font-face {
  font-family: "WhyteInktrap";
  src: url("../fonts/WhyteInktrap-Book.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3 {
  font-family: "WhyteInktrap", "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.2;
}

h1 {
  font-size: 3rem;
}

h2 {
  font-size: 2rem;
}

h3 {
  font-size: 1.25rem;
}

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

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ========================================
   Header / Navigation
   ======================================== */

.site-header {
  position: relative;
  padding: 1.5rem 10rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}

.site-title {
  font-family: "WhyteInktrap", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: #1a1a1a;
  letter-spacing: 0;
}

.site-nav a {
  font-family: "WhyteInktrap", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  margin-left: 2rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ========================================
   Homepage - Intro
   ======================================== */

.site-intro {
  padding: 10rem 10rem 5rem;
  background: #fff;
  color: #1a1a1a;
}

.intro-headline {
  font-size: clamp(1.25rem, 2.5vw, 1.75rem);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin-bottom: 2.5rem;
  max-width: 800px;
}

.intro-headline a:hover {
  text-decoration: underline;
}

.intro-bio {
  font-size: 1rem;
  line-height: 1.7;
  opacity: 0.45;
  max-width: 480px;
}

.intro-links {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
}

.intro-links a {
  color: #1a1a1a;
}

/* ========================================
   Homepage - Project Grid
   ======================================== */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5rem;
  padding: 8rem 10rem;
  background: #fff;
}

.project-card {
  position: relative;
  overflow: visible;
}

.project-card:nth-child(3n+1) {
  grid-column: span 2;
}

.project-card-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: #1a1a1a;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease, filter 0.6s ease;
}

.project-card-title {
  color: #1a1a1a;
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: uppercase;
}

.project-card-category {
  color: rgba(26, 26, 26, 0.35);
  font-size: 0.9rem;
  font-weight: 400;
  text-transform: uppercase;
}

.project-card-category::before {
  content: ' / ';
  margin: 0 0.3rem;
}

.project-card-overlay {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

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


.project-card-overlay {
  position: relative;
  padding: 1rem 0 0;
  display: flex;
  align-items: baseline;
}

.project-card-title,
.project-card-category {
  transform: translateY(10px);
}

.project-card:hover .project-card-title,
.project-card:hover .project-card-category {
  transform: translateY(0);
}

/* ========================================
   Project Page
   ======================================== */

.project-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  background: #fff;
}

.project-hero-image {
  display: none;
}

.project-hero-overlay {
  display: none;
}

.project-hero-content {
  position: relative;
  z-index: 1;
  padding: 10rem 10rem 6rem;
  color: #1a1a1a;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 4rem;
}

.project-hero-content h1 {
  grid-column: 1;
  grid-row: 1;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.project-info {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.project-description {
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.5;
  max-width: 480px;
}

.project-meta {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  opacity: 0.4;
  margin-top: 1rem;
}

/* Project Gallery */
.project-gallery {
  padding: 0 10rem 10rem;
  background: none;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5rem;
  max-width: 100%;
  margin: 0 auto;
}

.gallery-item {
  border-radius: 0;
  background: none;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* Back Button */
.back-button {
  position: fixed;
  top: 1.5rem;
  left: 2rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "WhyteInktrap", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: 0;
  background: none;
  border-radius: 0;
}


/* ========================================
   Lightbox
   ======================================== */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 0.2s;
}

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

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 3rem;
  cursor: pointer;
  padding: 1rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

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

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* ========================================
   Footer
   ======================================== */

.site-footer {
  padding: 4rem 2rem;
  background: #1a1a1a;
  color: #fff;
  text-align: center;
}

.footer-content {
  max-width: 600px;
  margin: 0 auto;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
}

.footer-links a {
  opacity: 0.7;
  transition: opacity 0.2s;
}

.footer-links a:hover {
  opacity: 1;
}

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

@media (max-width: 1024px) {
  .site-intro {
    display: none;
  }

  .intro-headline {
    font-size: 2rem;
  }

  .site-header {
    padding: 1rem;
  }

  .site-nav {
    display: none;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding: 1rem;
  }

  .project-card:nth-child(3n+1) {
    grid-column: span 1;
  }

  .project-card {
    aspect-ratio: 4 / 3;
  }

  .project-card-overlay {
    opacity: 1 !important;
    transform: translateY(0) !important;
    padding-top: 0.2rem;
  }

  .project-card-title {
    font-size: 0.8rem;
    margin-bottom: 0.2rem;
  }

  .project-hero-content {
    padding: 5rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .project-gallery {
    padding: 0 1rem;
  }

  .gallery-grid {
    gap: 1rem;
  }

  .back-button {
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
  }

  h1 {
    font-size: 2rem;
  }

  .project-card {
    opacity: 1;
    animation: none;
  }

}

/* ========================================
   Animations
   ======================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.6s ease forwards;
}

.project-card {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }
.project-card:nth-child(7) { animation-delay: 0.7s; }
.project-card:nth-child(8) { animation-delay: 0.8s; }
.project-card:nth-child(9) { animation-delay: 0.9s; }
.project-card:nth-child(10) { animation-delay: 1s; }
.project-card:nth-child(11) { animation-delay: 1.1s; }

/* ========================================
   Page Transition Overlay
   ======================================== */

.page-transition-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  pointer-events: all;
  opacity: 1;
  transition: opacity 0.4s ease;
}

.page-transition-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.page-transition-overlay.active {
  opacity: 1;
  pointer-events: all;
}

/* ========================================
   Marquee Demos
   ======================================== */

.marquee-demo {
  background: #fff;
  padding-top: 2rem;
}

.footer-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  padding: 0rem 0 8rem;
}

.footer-icons a {
  color: #1a1a1a;
}

.marquee-container {
  overflow-x: visible;
  overflow-y: visible;
  white-space: nowrap;
}

.marquee-track {
  display: inline-block;
  white-space: nowrap;
  font-family: "WhyteInktrap", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(2rem, 6vw, 5rem);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: #1a1a1a;
}

.marquee-track span {
  display: inline;
}

/* Simple marquee — continuous left scroll */
.marquee-simple {
  animation: marquee-scroll-left 20s linear infinite;
}

@keyframes marquee-scroll-left {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ========================================
   Marquee Responsive
   ======================================== */

@media (max-width: 1024px) {
  .marquee-track {
    font-size: clamp(1.5rem, 5vw, 3rem);
  }

  .marquee-container {
    padding: 0.75rem 0;
  }

  .footer-icons {
    padding: 0 0 3rem;
  }
}

/* ========================================
   Drag-and-Drop Reordering (Edit Mode)
   ======================================== */

.edit-mode-controls {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.edit-toggle-btn,
.save-order-btn,
.cancel-order-btn {
  padding: 0.6rem 1.2rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid #1a1a1a;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  font-family: inherit;
}

.edit-toggle-btn:hover,
.save-order-btn:hover {
  background: #1a1a1a;
  color: #fff;
}

.cancel-order-btn:hover {
  background: #f5f5f5;
}

.save-status {
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.gallery-grid.edit-mode .gallery-item[draggable="true"] {
  cursor: grab;
  outline: 2px dashed rgba(26, 26, 26, 0.15);
  outline-offset: 4px;
  transition: opacity 0.2s ease, outline-color 0.2s ease;
}

.gallery-grid.edit-mode .gallery-item[draggable="true"]:hover {
  outline-color: rgba(26, 26, 26, 0.4);
}

.gallery-grid.edit-mode .gallery-item.dragging {
  opacity: 0.3;
  cursor: grabbing;
}

.gallery-grid.edit-mode .gallery-item.drag-over {
  outline: 2px solid #1a1a1a;
  outline-offset: 4px;
}
