/* ------------------------------------------------------------------
   Infrasnaps — white on black, editorial portfolio style
------------------------------------------------------------------- */

:root {
  color-scheme: dark;
  --bg: #000000;
  --panel: #0a0a0a;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.6);
  --faint: rgba(255, 255, 255, 0.36);
  --line: rgba(255, 255, 255, 0.16);
  --line-soft: rgba(255, 255, 255, 0.09);
  --hover-bg: rgba(255, 255, 255, 0.06);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  --max: 1280px;
  --pad: clamp(1.25rem, 4vw, 4rem);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.02em;
}

img {
  display: block;
}

/* ---------------------------------------------------------------- */
/* Header                                                            */
/* ---------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 72px;
  padding: 0 var(--pad);
  border-bottom: 1px solid var(--line-soft);
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(16px);
}

.brand {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-links {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 2.4rem);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-links a {
  line-height: 2.2;
  border-bottom: 1px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

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

.nav-links a.current {
  color: var(--text);
  border-color: var(--text);
}

/* ---------------------------------------------------------------- */
/* Hero                                                              */
/* ---------------------------------------------------------------- */

.hero {
  position: relative;
  min-height: min(820px, calc(100vh - 72px));
  display: grid;
  align-items: end;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.94) 0%,
    rgba(0, 0, 0, 0.35) 45%,
    rgba(0, 0, 0, 0.25) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 16vh var(--pad) 8vh;
}

.eyebrow {
  margin: 0 0 1.1rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

h1 {
  max-width: 10ch;
  font-size: clamp(3.6rem, 11vw, 9.5rem);
  line-height: 0.92;
  letter-spacing: -0.03em;
}

h2 {
  max-width: 16ch;
  font-size: clamp(2rem, 5vw, 4.6rem);
  line-height: 1.02;
}

h3 {
  font-size: clamp(1.15rem, 1.9vw, 1.6rem);
  line-height: 1.15;
}

.hero-content > p:not(.eyebrow) {
  max-width: 520px;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.3rem);
  font-weight: 300;
  line-height: 1.65;
}

/* ---------------------------------------------------------------- */
/* "What is infrared photography?"                                    */
/* ---------------------------------------------------------------- */

.whatis {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: clamp(1.8rem, 4vw, 3rem) var(--pad) clamp(3.5rem, 7vw, 7rem);
  border-bottom: 1px solid var(--line-soft);
}

.whatis h2 {
  font-size: clamp(1.8rem, 4vw, 3.4rem);
}

.whatis-lead {
  max-width: 640px;
  margin: 1.6rem 0 0;
  color: var(--text);
  font-size: clamp(1.15rem, 2.2vw, 1.7rem);
  font-weight: 300;
  line-height: 1.45;
}

.whatis-story {
  max-width: 720px;
  display: grid;
  gap: 1.1rem;
  margin-top: 2rem;
}

.whatis-story p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.4vw, 1.05rem);
  font-weight: 300;
  line-height: 1.8;
}

.whatis-closer {
  margin: 2.2rem 0 0;
}

.whatis-closer a {
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  transition: border-color 160ms ease;
}

.whatis-closer a:hover {
  border-color: var(--text);
}

/* ---------------------------------------------------------------- */
/* Sections (work / gear / about / contact)                          */
/* ---------------------------------------------------------------- */

.section,
.info-row,
.contact {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 7rem) var(--pad);
}

.info-row,
.contact {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
  border-top: 1px solid var(--line-soft);
}

.info-row > p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  font-weight: 300;
  line-height: 1.8;
}

.section-heading {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

/* ---------------------------------------------------------------- */
/* Gallery                                                           */
/* ---------------------------------------------------------------- */

.gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.filter-button {
  min-height: 2.5rem;
  padding: 0 0.95rem;
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.filter-button:hover {
  border-color: var(--line);
  color: var(--text);
}

.filter-button.active {
  border-color: var(--text);
  background: var(--text);
  color: #000;
}

/* Adobe-style masonry — uniform column widths, every photo at its natural
   aspect ratio (no cropping, no letterbox bars), sliders flow in the
   columns like everything else. */
.gallery {
  columns: 3;
  column-gap: 1rem;
}

.photo-card {
  position: relative;
  overflow: hidden;
  break-inside: avoid;
  margin: 0 0 1rem;
  background: #000;
  cursor: zoom-in;
}

/* Photos show FULLY at their natural proportions — zero bars. */
.photo-card img.photo-img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 700ms cubic-bezier(0.19, 1, 0.22, 1);
}

/* Transparent shield over photos — blocks right-click "Save image as…". */
.photo-guard {
  position: absolute;
  inset: 0;
  z-index: 1;
}

/* Gold star on featured photos */
.featured-star {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 2;
  color: #ffd76a;
  font-size: 0.95rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.ba-handle,
.ba-tag {
  z-index: 2;
}

.photo-card:hover img.photo-img {
  transform: scale(1.015);
}

.photo-card .ba-slider {
  width: 100%;
  height: auto;
  min-height: 0;
}

.wm-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Hover caption — Adobe Portfolio style overlay */
.photo-overlay {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.6rem 1rem 0.75rem;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}

.photo-card:hover .photo-overlay {
  opacity: 1;
}

.photo-overlay strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 500;
}

.photo-overlay span {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.gallery-error {
  padding: 2rem 0;
  color: var(--muted);
  font-size: 1rem;
}

.gallery-error code {
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

/* ---------------------------------------------------------------- */
/* Before / after slider                                             */
/* ---------------------------------------------------------------- */

.ba-slider {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  background: #000; /* match the page background when images letterbox */
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.ba-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.ba-top {
  will-change: clip-path;
}

.ba-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.92);
  transform: translateX(-50%);
  cursor: ew-resize;
  outline: none;
}

.ba-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -10px;
  width: 20px; /* larger hit area */
}

.ba-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  transform: translate(-50%, -50%);
  backdrop-filter: blur(4px);
}

.ba-grip::before,
.ba-grip::after {
  color: #fff;
  font-size: 0.85rem;
  line-height: 1;
}

.ba-grip::before {
  content: "\2039"; /* ‹ */
}

.ba-grip::after {
  content: "\203A"; /* › */
}

.ba-handle:focus-visible .ba-grip {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.ba-tag {
  position: absolute;
  top: 0.85rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.6);
  color: var(--text);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  pointer-events: none;
}

.ba-tag-left {
  left: 0.85rem;
}

.ba-tag-right {
  right: 0.85rem;
}

/* ---------------------------------------------------------------- */
/* About page                                                        */
/* ---------------------------------------------------------------- */

.about-page {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 8rem) var(--pad);
}

.about-title {
  max-width: 16ch;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1;
}

.about-story {
  max-width: 720px;
  display: grid;
  gap: 1.4rem;
  margin-top: clamp(2rem, 4.5vw, 3.5rem);
}

.about-story p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  font-weight: 300;
  line-height: 1.8;
}

.about-page .contact {
  width: 100%;
  margin: clamp(3.5rem, 7vw, 7rem) 0 0;
  padding-left: 0;
  padding-right: 0;
}

/* ---------------------------------------------------------------- */
/* Gear / series / about / contact                                   */
/* ---------------------------------------------------------------- */

.spec-list {
  display: grid;
  border-top: 1px solid var(--line-soft);
}

.spec-list div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.spec-list span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.spec-list strong {
  font-size: clamp(1rem, 1.7vw, 1.25rem);
  font-weight: 400;
}

.series-grid {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 0 var(--pad) clamp(3.5rem, 7vw, 7rem);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.series-grid article {
  min-height: 250px;
  display: grid;
  align-content: space-between;
  gap: 1.2rem;
  padding: 1.4rem;
  border: 1px solid var(--line-soft);
  background: var(--panel);
  transition: border-color 200ms ease;
}

.series-grid article:hover {
  border-color: var(--line);
}

.series-grid .series-number {
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.series-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.7;
}

.contact {
  align-items: center;
}

.contact-links {
  display: grid;
  gap: 0.9rem;
  justify-items: start;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-size: clamp(1.05rem, 2.2vw, 2.1rem);
  font-weight: 400;
  line-height: 1.2;
  border-bottom: 1px solid var(--line);
  transition: border-color 160ms ease, color 160ms ease;
}

.contact-icon {
  width: 1.1em;
  height: 1.1em;
  flex: none;
}

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

/* ---------------------------------------------------------------- */
/* Footer                                                            */
/* ---------------------------------------------------------------- */

.site-footer {
  display: grid;
  justify-items: center;
  gap: 1.2rem;
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) var(--pad) 3.5rem;
  border-top: 1px solid var(--line-soft);
  text-align: center;
}

.social-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.social-icon svg {
  width: 27px;
  height: 27px;
}

.social-icon:hover {
  background: var(--text);
  border-color: var(--text);
  color: #000;
}

.footer-meta {
  display: grid;
  gap: 0.3rem;
  color: var(--faint);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.footer-meta span:first-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.footer-copy {
  margin: 0;
  color: var(--faint);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  line-height: 1.8;
  text-transform: uppercase;
}

.footer-rights {
  max-width: 560px;
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 300;
  line-height: 1.7;
  letter-spacing: 0.02em;
  text-transform: none;
}

/* ---------------------------------------------------------------- */
/* Lightbox                                                          */
/* ---------------------------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  align-content: center;
  padding: 4.5rem clamp(1rem, 4vw, 4rem) 1.5rem;
  background: rgba(0, 0, 0, 0.94);
}

.lightbox.open {
  display: grid;
}

.lightbox-body {
  width: min(1400px, 100%);
}

/* Shrink the lightbox content area to the image/slider itself, so clicks
   outside it hit the backdrop and close the lightbox. */
.lightbox-body:has(> img.photo-img),
.lightbox-body:has(> .ba-slider) {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.lightbox img.photo-img {
  max-width: 92vw;
  max-height: 76vh;
  margin: 0 auto;
  object-fit: contain;
}

.lightbox .ba-slider {
  min-height: 300px;
}

.lightbox-close {
  position: absolute;
  top: 1.1rem;
  right: 1.1rem;
  z-index: 3;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lightbox-close:hover {
  border-color: var(--text);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  cursor: pointer;
  font-size: 1.6rem;
  line-height: 1;
  transform: translateY(-50%);
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.lightbox-nav:hover {
  background: var(--text);
  border-color: var(--text);
  color: #000;
}

.lightbox-prev {
  left: clamp(0.6rem, 2vw, 1.6rem);
}

.lightbox-next {
  right: clamp(0.6rem, 2vw, 1.6rem);
}

.lightbox-count {
  margin-top: 0.45rem;
  color: var(--faint);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-align: center;
}

.lightbox-caption {
  margin-top: 1.1rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.lightbox-caption .lightbox-folder {
  color: var(--faint);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- */
/* Responsive                                                        */
/* ---------------------------------------------------------------- */

@media (max-width: 900px) {
  .gallery {
    columns: 2;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    min-height: 96px;
    padding-block: 0.95rem;
  }

  .nav-links {
    position: static;
    transform: none;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.1rem;
  }

  .hero {
    min-height: 640px;
  }

  .info-row,
  .series-grid,
  .contact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .gallery {
    columns: 1;
  }
}

/* The gallery uses the full screen width. */
#work.section {
  width: 100%;
  max-width: none;
}

@media (max-width: 560px) {
  .nav-links {
    gap: 1.1rem;
    font-size: 0.7rem;
  }

  h1 {
    font-size: clamp(3.4rem, 17vw, 5.4rem);
  }

  .hero-content {
    padding-bottom: 3.5rem;
  }

  .spec-list div {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .photo-caption {
    display: grid;
  }

  .ba-slider {
    min-height: 260px;
  }
}
