/* ============================================================
   PHOTOGRAPHY PORTFOLIO — Style
   Art direction: Anecdote NYC warmth + Oxidist book typography
   ============================================================ */

/* --- Design Tokens --- */
:root {
  /* Type scale (fluid) */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);

  /* Spacing (4px base) */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Fonts */
  --font-body: 'Crimson Pro', 'Georgia', serif;
  --font-display: 'Crimson Pro', 'Georgia', serif;
  --font-label: 'Satoshi', 'Helvetica Neue', sans-serif;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Light Mode (default) --- */
:root, [data-theme="light"] {
  --color-bg:          #faf8f3;
  --color-surface:     #f5f2eb;
  --color-text:        #1a1815;
  --color-text-muted:  #6e6b64;
  --color-text-faint:  #767370;
  --color-accent:      #5b3b40;
  --color-accent-hover:#4a2d32;
  --color-border:      #d4d0c8;
  --color-divider:     #e2dfd8;
}

/* --- Dark Mode --- */
[data-theme="dark"] {
  --color-bg:          #141311;
  --color-surface:     #1e1d1a;
  --color-text:        #d5d3ce;
  --color-text-muted:  #8a8882;
  --color-text-faint:  #777471;
  --color-accent:      #c2929a;
  --color-accent-hover:#d4a8af;
  --color-border:      #3d3c38;
  --color-divider:     #2a2926;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:          #141311;
    --color-surface:     #1e1d1a;
    --color-text:        #d5d3ce;
    --color-text-muted:  #8a8882;
    --color-text-faint:  #777471;
    --color-accent:      #c2929a;
    --color-accent-hover:#d4a8af;
    --color-border:      #3d3c38;
    --color-divider:     #2a2926;
  }
}

/* ============================================================
   LAYOUT
   ============================================================ */

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  letter-spacing: 0.01em;
}

.site-wrapper {
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 1024px) {
  .site-wrapper {
    padding-inline: var(--space-12);
  }
}

/* ============================================================
   HEADER — Oxidist-style sidebar feel on desktop, top on mobile
   ============================================================ */

.site-header {
  padding-block: var(--space-8);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}

.logo-svg {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  transition: transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.logo-link:hover .logo-svg {
  animation: logo-spin 8s linear infinite;
}

@keyframes logo-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.logo-wordmark {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-link {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: none;
  text-decoration: none;
  color: var(--color-text-muted);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--color-text);
  transition: width 300ms var(--ease-out);
}

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

.nav-link:hover::after {
  width: 100%;
}

.theme-toggle {
  padding: var(--space-3);
  min-width: 44px;
  min-height: 44px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:hover {
  color: var(--color-text);
}

/* ============================================================
   HERO — Anecdote-style warm, document-like introduction
   ============================================================ */

.hero {
  padding-block: var(--space-12) var(--space-16);
  display: grid;
  gap: var(--space-8);
}

@media (min-width: 768px) {
  .hero {
    grid-template-columns: 160px 1fr;
    gap: var(--space-12);
    padding-block: var(--space-16) var(--space-12);
  }
}

.hero-label {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: left;
}

@media (min-width: 768px) {
  .hero-label {
    text-align: right;
    padding-top: 0.35em;
  }
}

.hero-content h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 300;
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--color-text);
  margin-bottom: var(--space-6);
}

.hero-content p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 55ch;
  line-height: 1.8;
}

/* ============================================================
   SECTION LABEL — Anecdote ledger-style labels
   ============================================================ */

.section-row {
  display: grid;
  gap: var(--space-6);
  padding-block: var(--space-8);
  border-top: 1px solid var(--color-divider);
}

@media (min-width: 768px) {
  .section-row {
    grid-template-columns: 160px 1fr;
    gap: var(--space-12);
    padding-block: var(--space-10);
  }
}

.section-label {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-align: left;
}

@media (min-width: 768px) {
  .section-label {
    text-align: right;
    padding-top: 0.35em;
  }
}

/* ============================================================
   GALLERY — Grid of placeholder image slots
   ============================================================ */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.gallery-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  cursor: pointer;
}


.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease-out), opacity 400ms var(--ease-out);
}

.gallery-item:hover img {
  transform: scale(1.03);
}

/* Placeholder state — shown when no real image is loaded */
.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--color-text-faint);
  font-family: var(--font-label);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gallery-placeholder svg {
  width: 32px;
  height: 32px;
  opacity: 0.4;
}

/* Caption overlay on hover */
.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-4) var(--space-4) var(--space-3);
  background: linear-gradient(to top, rgba(0,0,0,0.72), transparent);
  color: #f0ede6;
  font-family: var(--font-label);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: none;
  font-weight: 500;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}

.gallery-item:hover .gallery-caption {
  opacity: 1;
  transform: translateY(0);
}

/* Always show captions on touch devices */
@media (hover: none) {
  .gallery-caption {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   FEATURED IMAGE — Full-width break
   ============================================================ */

.featured-image {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  aspect-ratio: 21 / 9;
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
  overflow: hidden;
  position: relative;
}

.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.featured-image .featured-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  color: var(--color-text-faint);
  font-family: var(--font-label);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ============================================================
   SEE MORE LINK
   ============================================================ */

.see-more-link {
  grid-column: 1 / -1;
  justify-self: start;
  display: inline-block;
  margin-top: var(--space-4);
  margin-bottom: var(--space-2);
  font-family: var(--font-label);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: lowercase;
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color var(--transition-interactive);
}

.see-more-link:hover {
  color: var(--color-text);
}

/* ============================================================
   CONTACT — Anecdote-style minimal form
   ============================================================ */

.contact-content {
  max-width: 480px;
}

.contact-content p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  line-height: 1.8;
}

.contact-email {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-1);
  transition: border-color 300ms var(--ease-out), color 300ms var(--ease-out);
}

.contact-email:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.contact-links {
  display: flex;
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.contact-links a {
  font-family: var(--font-label);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  text-transform: none;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-interactive);
}

.contact-links a:hover {
  color: var(--color-text);
}



/* ============================================================
   LIGHTBOX
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms var(--ease-out);
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border: none;
}

.lightbox-close {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  color: #d5d3ce;
  padding: var(--space-2);
  min-width: 44px;
  min-height: 44px;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close:hover { color: #fff; }

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #d5d3ce;
  padding: var(--space-3);
  min-width: 44px;
  min-height: 44px;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 200ms, opacity 200ms;
}

.lightbox-prev { left: var(--space-6); }
.lightbox-next { right: var(--space-6); }

.lightbox-prev:hover,
.lightbox-next:hover { color: #fff; }

.lightbox-counter {
  position: absolute;
  bottom: var(--space-6);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-label);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.5);
  user-select: none;
}

/* ============================================================
   SCROLL REVEALS — CSS-only, opacity-based (no layout shift)
   ============================================================ */

.reveal {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .reveal {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 80%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}

/* Stagger delays for gallery items */
.gallery-item:nth-child(2) { animation-delay: 60ms; }
.gallery-item:nth-child(3) { animation-delay: 120ms; }
.gallery-item:nth-child(4) { animation-delay: 180ms; }
.gallery-item:nth-child(5) { animation-delay: 240ms; }
.gallery-item:nth-child(6) { animation-delay: 300ms; }
.gallery-item:nth-child(7) { animation-delay: 360ms; }
.gallery-item:nth-child(8) { animation-delay: 420ms; }
.gallery-item:nth-child(9) { animation-delay: 480ms; }

/* ============================================================
   DECORATIVE — Oxidist star bullets
   ============================================================ */

.star-bullet::before {
  content: '✧';
  margin-right: var(--space-3);
  color: var(--color-text-faint);
}

/* ============================================================
   RESPONSIVE FINE-TUNING
   ============================================================ */

@media (max-width: 639px) {
  .hero-content h1 {
    font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.5rem);
  }

  .site-header {
    padding-block: var(--space-6);
  }

  .logo-wordmark {
    font-size: var(--text-base);
  }

  .section-row {
    padding-block: var(--space-8);
  }

  .featured-image {
    aspect-ratio: 16 / 9;
  }
}
