@keyframes page-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body {
  animation: page-fade-in 0.5s ease-out forwards;
}

:root {
  --color-muted: #999;
  --color-accent-bg: #e8a800;
}

html {
  scroll-behavior: smooth;
}

/* ── Sections ────────────────────────────────────────────── */

section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: var(--nav-height) 2.5rem 4rem clamp(2.5rem, 8vw, 8rem);
  scroll-margin-top: 0;
  position: relative;
  background-color: var(--color-bg);
  background-size: cover;
  background-position: center;
}

/* Home — text anchors to bottom-left, photograph breathes above */
#home {
  justify-content: flex-end;
  padding-bottom: 10vh;
}

/* Home hero title — larger and tighter than other sections */
#home .section-content {
  max-width: min(100%, 820px);
}

#home .section-title {
  font-size: clamp(3rem, 6vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* About — mirror the asymmetric left padding on the right for visual balance */
#about {
  padding-right: clamp(2.5rem, 8vw, 8rem);
}

/* Image sections — background stays fixed while scrolling (parallax) */
section:nth-of-type(odd) {
  background-attachment: fixed;
}

/* iOS Safari does not support background-attachment: fixed reliably */
@supports (-webkit-touch-callout: none) {
  section:nth-of-type(odd) {
    background-attachment: scroll;
  }
}

/* ── Scroll hint ─────────────────────────────────────────── */

@keyframes scroll-hint-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(6px); }
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: rgba(255, 255, 255, 0.32);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.scroll-hint.visible {
  opacity: 1;
  animation: scroll-hint-bounce 2s ease-in-out infinite;
}

.scroll-hint.hidden {
  opacity: 0;
  animation: none;
}

/* ── Home background slideshow ───────────────────────────── */

#home-slides {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.bg-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  opacity: 0;
  transition: opacity 1.2s ease-in-out;
}

/* iOS Safari does not support background-attachment: fixed reliably */
@supports (-webkit-touch-callout: none) {
  .bg-slide {
    background-attachment: scroll;
  }
}

.bg-slide.active {
  opacity: 1;
}

/* Even sections — golden background with monochrome-tinted image */
section:nth-of-type(even) {
  background-color: var(--color-accent-bg);
  background-blend-mode: luminosity;
}

/* Semi-opaque golden wash over the blended image — keeps text readable */
section:nth-of-type(even)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(232, 168, 0, 0.92);
  z-index: 0;
}

/* Even sections use dark text on gold — ~9:1 contrast vs the bright background.
   White text on gold is a losing battle; dark amber-brown is not. */
section:nth-of-type(even) .section-title {
  color: #1a1400;
  text-shadow: 0 1px 8px rgba(255, 210, 80, 0.45);
}

section:nth-of-type(even) .section-label {
  color: #1a1400;
  text-shadow: 0 1px 6px rgba(255, 210, 80, 0.35);
}

section:nth-of-type(even) .section-body {
  color: #3a2c00;
  text-shadow: 0 1px 6px rgba(255, 210, 80, 0.3);
}

section:nth-of-type(even) .section-sublabel {
  color: #3a2c00;
  opacity: 1;
  text-shadow: 0 1px 6px rgba(255, 210, 80, 0.3);
}

section:nth-of-type(even) .cta {
  color: #1a1400;
  border-color: rgba(0, 0, 0, 0.3);
}

section:nth-of-type(even) .cta:hover {
  border-color: rgba(0, 0, 0, 0.7);
  color: #000;
}

section:nth-of-type(even) .contact-links a {
  color: #3a2c00;
  border-color: rgba(0, 0, 0, 0.2);
}

section:nth-of-type(even) .contact-links a:hover {
  color: #1a1400;
  border-color: rgba(0, 0, 0, 0.6);
}

/* Dark overlay for image sections only */
section:nth-of-type(odd)::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 7, 2, 0.76);
  z-index: 1;
}

/* Gradient scrim — home text sits at the bottom, so pool the darkness there.
   Photo stays clear at the top; text has a reliable dark backing below. */
#home::after,
#about::after {
  content: '';
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

#home::after {
  left: 0;
  right: 0;
  bottom: 0;
  height: 75%;
  background: linear-gradient(
    to top,
    rgba(8, 6, 2, 0.92) 0%,
    rgba(8, 6, 2, 0.55) 45%,
    transparent 75%
  );
}

/* About — horizontal scrim: text is on the left, photo on the right. */
#about::after {
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(8, 6, 2, 0.85) 0%,
    rgba(8, 6, 2, 0.50) 40%,
    transparent 68%
  );
}

/* Text shadows — imperceptible as shadows, experienced as contrast.
   Ensures readability regardless of photo brightness behind the text. */
section:nth-of-type(odd) .section-label,
section:nth-of-type(odd) .section-title,
section:nth-of-type(odd) .section-body {
  text-shadow: 0 1px 20px rgba(0, 0, 0, 0.75), 0 1px 6px rgba(0, 0, 0, 0.5);
}

section:nth-of-type(odd) .contact-links a {
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.7);
}

section:nth-of-type(odd) .about-anecdote,
section:nth-of-type(odd) .gear-list {
  text-shadow: 0 1px 20px rgba(0, 0, 0, 0.75), 0 1px 6px rgba(0, 0, 0, 0.5);
}

.section-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  max-width: 540px;
}

.section-label {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  text-align: left;
  line-height: 1.1;
}

.section-body {
  margin-top: 1.5rem;
  max-width: 480px;
  text-align: left;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--color-muted);
}

/* ── Home ────────────────────────────────────────────────── */

#home .section-title .title-accent {
  display: block;
  font-style: italic;
  color: var(--color-accent);
}

/* ── Photos ──────────────────────────────────────────────── */

/* Two-column layout: text left, photo preview right */
#photos {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: clamp(3rem, 6vw, 6rem);
  padding-right: clamp(2.5rem, 8vw, 8rem); /* mirror asymmetric left padding */
}

/* External platform links — demoted below primary CTA with visual separator */
#photos .section-sublabel {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}

.photos-preview {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: clamp(280px, 34vw, 460px);
  flex-shrink: 0;
}

.preview-cell {
  display: block;
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  /* Gold-toned shimmer — integrates with the section during load */
  background: linear-gradient(90deg, #b89600 25%, #c8a800 50%, #b89600 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Shoot title caption — appears on hover via CSS attr() */
.preview-cell::after {
  content: attr(title);
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  padding: 0.75rem 0.6rem 0.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, transparent 100%);
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.preview-cell:hover::after {
  opacity: 1;
}

.preview-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.35s ease, filter 0.25s;
}

.preview-cell img.loaded {
  opacity: 1;
}

.preview-cell:hover img {
  transform: scale(1.04);
  filter: brightness(1.12);
}

.preview-cell.preview-error {
  animation: none;
  background: rgba(0, 0, 0, 0.08);
}

@media (max-width: 900px) {
  #photos {
    flex-direction: column;
  }

  .photos-preview {
    display: none;
  }

}

.cta {
  display: inline-block;
  margin-top: 2.5rem;
  padding: 0.75rem 2rem;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
  border: 1px solid var(--color-border);
  border-radius: 3px;
  transition: border-color 0.2s, color 0.2s;
}

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

.section-sublabel {
  margin-top: 2rem;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: inherit;
  opacity: 0.5;
}

/* ── Contact ─────────────────────────────────────────────── */

.contact-links {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 1.5rem;
}

.contact-links a {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
  transition: color 0.2s, border-color 0.2s;
}

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

/* Contact section — centered closing composition with flanking photos */

#contact {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 4vw, 4.5rem);
  padding-inline: 2.5rem; /* symmetric — overrides the left-offset base padding */
}

#contact .section-content {
  align-items: center;
  text-align: center;
  max-width: min(100%, 600px);
}

#contact .section-body {
  text-align: center;
}

.contact-photos {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: clamp(130px, 13vw, 190px);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.contact-email {
  display: inline-block;
  margin-top: 2.5rem;
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  font-weight: 300;
  letter-spacing: 0.04em;
  color: #1a1400;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
  padding-bottom: 4px;
  transition: border-color 0.2s, color 0.2s;
}

.contact-email:hover {
  color: #000;
  border-color: rgba(0, 0, 0, 0.65);
}

.contact-divider {
  width: 2rem;
  height: 1px;
  background: rgba(0, 0, 0, 0.2);
  margin: 2rem auto 0;
}

#contact .contact-links {
  justify-content: center;
}

@media (max-width: 900px) {
  #contact {
    flex-direction: column;
    padding-inline: revert; /* restore asymmetric base-section padding */
  }

  .contact-photos {
    display: none;
  }
}

/* ── About ───────────────────────────────────────────────── */

.about-content {
  max-width: min(100%, 1100px);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr min(340px, 38%);
  gap: 3.5rem;
  align-items: start;
  width: 100%;
  margin-top: 1.5rem;
}

.about-anecdote {
  margin-top: 2rem;
  padding-left: 1.25rem;
  border-left: 2px solid var(--color-accent);
  font-size: 0.88rem;
  line-height: 1.75;
  color: var(--color-muted);
  font-style: italic;
}

.gear-label {
  margin-top: 2.25rem;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.75rem;
}

.gear-list {
  list-style: none;
  font-size: 0.82rem;
  color: var(--color-muted);
  letter-spacing: 0.04em;
  line-height: 2;
}

.about-figure {
  margin: 0;
}

.about-figure img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 18% center;
  display: block;
  filter: grayscale(15%);
}

@media (max-width: 680px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .about-figure {
    order: -1;
  }

  .about-figure img {
    aspect-ratio: 4 / 3;
  }

  /* On mobile the layout stacks vertically — replace the horizontal
     left-to-right scrim with a bottom-anchored vertical gradient so
     the dark backing stays under the text rather than cutting across it */
  #about::after {
    inset: 0;
    background: linear-gradient(
      to top,
      rgba(8, 6, 2, 0.70) 0%,
      rgba(8, 6, 2, 0.35) 50%,
      transparent 75%
    );
  }
}
