/* ==========================================================================
   photography.css — photography.html, always dark: hero, intro, justified
   gallery, prints, and the lightbox (with the Bayer sensor view)
   ========================================================================== */

/* ---------- Hero ---------- */
.ph-hero {
  position: relative;
  height: 100svh; min-height: 600px;
  display: flex; align-items: flex-end;
  overflow: hidden; isolation: isolate;
  color: #f4f1ea;
  background: #8d8b86;
}
.ph-hero__img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover;
  transform-origin: 60% 45%;
  animation: kenburns 26s var(--ease-out) both;
}
@keyframes kenburns { from { transform: scale(1.14); } to { transform: scale(1.02); } }
.ph-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(to bottom, rgba(10, 10, 8, 0.55), transparent 160px),
    linear-gradient(to top, rgba(10, 10, 8, 0.92) 0%, rgba(10, 10, 8, 0.35) 42%, rgba(10, 10, 8, 0.05) 65%, rgba(10, 10, 8, 0.4) 100%);
}
.ph-hero__frame { inset: calc(var(--nav-h) + 14px) var(--gutter) 14px; --corner: rgba(255, 255, 255, 0.55); }

.ph-hero__content { position: relative; padding-bottom: clamp(48px, 8vh, 88px); }
.ph-hero__eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: rgba(244, 241, 234, 0.75); }
.ph-hero__title {
  margin: 0.08em 0 0.18em;
  font-family: var(--font-serif); font-weight: 400;
  font-size: clamp(4.4rem, 15vw, 15rem); line-height: 0.82; letter-spacing: -0.04em;
}
.ph-hero__title em { color: var(--accent); }
.ph-hero__title .line { display: block; overflow: hidden; padding-bottom: 0.05em; }
.ph-hero__title .line > span { display: inline-block; }
.js .ph-hero__title .line > span { transform: translateY(105%); animation: rise 1.3s var(--ease-out) forwards; animation-delay: calc(0.2s + var(--i, 0) * 0.14s); }
.ph-hero__meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px 40px; }
.ph-hero__lede { max-width: 40ch; margin: 0; font-size: clamp(1.02rem, 1.3vw, 1.2rem); color: rgba(244, 241, 234, 0.82); }
.ph-hero__exif { display: grid; gap: 4px; text-align: right; color: rgba(244, 241, 234, 0.7); transition: color 0.2s; }
.ph-hero__exif:hover { color: #fff; }
.ph-hero__cue {
  position: absolute; right: calc(var(--gutter) + 28px); top: calc(var(--nav-h) + 40px);
  display: inline-flex; align-items: center; gap: 8px;
  color: rgba(244, 241, 234, 0.75);
}
.ph-hero__cue:hover { color: #fff; }
@media (max-width: 720px) {
  .ph-hero__exif { text-align: left; }
  .ph-hero__cue { display: none; }
}

/* ---------- Intro ---------- */
.ph-intro { padding-block: clamp(64px, 8vw, 112px) clamp(40px, 5vw, 64px); }
.ph-intro__text {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.7rem, 3vw, 2.7rem); line-height: 1.15; letter-spacing: -0.015em;
  max-width: 36ch;
}

/* ---------- Toolbar ---------- */
.ph-toolbar {
  position: sticky; top: var(--nav-h); z-index: 20;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-block: 1px solid var(--line);
  scroll-margin-top: var(--nav-h);
}
.ph-toolbar__inner { display: flex; align-items: center; gap: 16px; min-height: 60px; }
.ph-toolbar .filters { display: flex; gap: 8px; margin: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-block: 10px; }
.ph-toolbar .filters::-webkit-scrollbar { display: none; }
.ph-toolbar .filter { flex: none; }
.ph-count { margin-left: auto; color: var(--ink-3); white-space: nowrap; }
@media (max-width: 640px) { .ph-count { display: none; } }

/* ---------- Justified gallery ---------- */
.ph-gallery { padding-block: 28px clamp(72px, 10vw, 140px); }
.gallery { --gap: 10px; display: flex; flex-wrap: wrap; gap: var(--gap); transition: opacity 0.25s var(--ease); }
.gallery.is-switching { opacity: 0; }

.tile {
  position: relative; flex: none;
  display: block; overflow: hidden;
  border-radius: 6px;
  background: var(--c, #222);
  cursor: zoom-in;
}
.tile img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.06);
  transition: opacity 0.9s var(--ease), transform 1.4s var(--ease-out);
}
.tile img.is-loaded { opacity: 1; transform: scale(1); }
.tile:hover img.is-loaded { transform: scale(1.04); }
.tile__cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px;
  padding: 40px 14px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  color: #fff;
  opacity: 0; transform: translateY(8px);
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease-out);
}
.tile:hover .tile__cap, .tile:focus-visible .tile__cap { opacity: 1; transform: none; }
.tile__title { font-family: var(--font-serif); font-size: 1.35rem; line-height: 1.05; }
.tile__loc { display: block; margin-top: 3px; font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.tile__meta { display: grid; justify-items: end; gap: 4px; flex: none; }
.tile__n { font-family: var(--font-mono); font-size: 0.66rem; opacity: 0.7; }
.tile.is-in { animation: fade-up 0.7s var(--ease-out) both; animation-delay: var(--d, 0s); }
@media (hover: none) {
  .tile__cap { opacity: 1; transform: none; padding: 24px 10px 8px; background: linear-gradient(transparent, rgba(0, 0, 0, 0.55)); }
  .tile__title { font-size: 0.95rem; }
  .tile__loc, .tile__meta { display: none; }
}

/* ---------- Prints ---------- */
.ph-prints {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(40px, 7vw, 112px); align-items: center;
  padding-block: clamp(80px, 10vw, 140px);
  border-top: 1px solid var(--line);
}
.ph-prints__title { margin: 12px 0 20px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.8rem, 5.5vw, 5rem); line-height: 0.95; letter-spacing: -0.025em; }
.ph-prints__title em { color: var(--accent); }
.ph-prints p { color: var(--ink-2); max-width: 46ch; }
.ph-prints__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.print-mock { margin: 0; padding: clamp(24px, 5vw, 64px); border-radius: var(--radius); background: radial-gradient(ellipse at 50% 20%, #2a2924, #151512 70%); }
.print-mock__paper {
  margin: 0 auto; max-width: 560px;
  padding: 7% 7% 4%;
  background: #f4f1ea;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), 0 40px 80px -30px rgba(0, 0, 0, 0.8);
  transform: rotate(-1.2deg);
  transition: transform 0.8s var(--ease-out);
}
.print-mock:hover .print-mock__paper { transform: rotate(0deg) scale(1.01); }
.print-mock img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; background: #8793ad; }
.print-mock figcaption { display: flex; justify-content: space-between; margin-top: 12px; color: #6d685c; font-size: 0.62rem; }
@media (max-width: 900px) { .ph-prints { grid-template-columns: 1fr; } }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; height: 100svh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: #0a0a09;
  color: #ece8dd;
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(8, 8, 7, 0.9); }
.lightbox[open] { animation: fade 0.3s var(--ease); }
.lb { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: 60px minmax(0, 1fr); height: 100%; }
.lb__top {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 14px 0 24px;
  color: rgba(236, 232, 221, 0.6);
  border-bottom: 1px solid rgba(236, 232, 221, 0.08);
}
.lb__hint { opacity: 0.7; }
.lb__close { border-color: rgba(236, 232, 221, 0.2); color: #ece8dd; }
.lb__close:hover { border-color: #ece8dd; }

.lb__stage { position: relative; min-height: 0; padding: 24px 76px; touch-action: pan-y; }
.lb__figure { position: relative; margin: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.lb__figure img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  border-radius: 3px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8);
  transition: opacity 0.35s var(--ease), transform 0.5s var(--ease-out);
}
.lb__figure img.is-swapping { opacity: 0; transform: scale(0.985); }
.lb__figure canvas { position: absolute; border-radius: 3px; image-rendering: pixelated; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.8); }
.lb__figure canvas:not([hidden]) { animation: fade 0.35s var(--ease); }
.lb__spinner {
  position: absolute; top: 50%; left: 50%; width: 28px; height: 28px; margin: -14px 0 0 -14px;
  border-radius: 50%; border: 2px solid rgba(236, 232, 221, 0.25); border-top-color: #ece8dd;
  animation: spin 0.8s linear infinite; opacity: 0; transition: opacity 0.2s;
}
.lb__figure.is-loading .lb__spinner { opacity: 1; }
.lb__nav {
  position: absolute; top: 50%; z-index: 2; translate: 0 -50%;
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid rgba(236, 232, 221, 0.18); color: #ece8dd;
  background: rgba(8, 8, 7, 0.4);
  transition: border-color 0.2s, background-color 0.2s;
}
.lb__nav:hover { border-color: #ece8dd; background: rgba(236, 232, 221, 0.08); }
.lb__nav--prev { left: 16px; }
.lb__nav--next { right: 16px; }

.lb__info {
  min-height: 0; overflow-y: auto;
  padding: 32px 28px;
  border-left: 1px solid rgba(236, 232, 221, 0.08);
  display: flex; flex-direction: column; gap: 6px;
}
.lb__cat { margin: 0; color: var(--accent); }
.lb__title { margin: 6px 0 6px; font-family: var(--font-serif); font-weight: 400; font-size: clamp(2.2rem, 3vw, 3rem); line-height: 1; letter-spacing: -0.02em; }
.lb__loc { display: flex; align-items: center; gap: 8px; margin: 0 0 18px; color: rgba(236, 232, 221, 0.7); }
.exif { margin: 0 0 22px; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid rgba(236, 232, 221, 0.12); }
.exif > div { padding: 12px 0; border-bottom: 1px solid rgba(236, 232, 221, 0.08); display: grid; gap: 2px; }
.exif > div.wide { grid-column: 1 / -1; }
.exif dt { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; color: rgba(236, 232, 221, 0.45); }
.exif dd { margin: 0; font-variant-numeric: tabular-nums; }
.exif .hex { font-size: 0.8rem; letter-spacing: 0.04em; }
.lb__sensor-note { margin: -8px 0 18px; font-size: 0.86rem; line-height: 1.5; color: rgba(236, 232, 221, 0.6); }
.lb__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 8px; }
.sensor-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent) !important; color: #fff !important; }
.sensor-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.lb__actions .btn--solid { background: #ece8dd; color: #0e0e0c; }
.lb__actions .btn--solid:hover { background: var(--accent); color: #fff; }
.lb__actions .btn--ghost { border-color: rgba(236, 232, 221, 0.2); color: #ece8dd; }
.lb__actions .btn--ghost:hover { border-color: #ece8dd; }
.copy-link .i--check { display: none; }
.copy-link.is-copied .i--link { display: none; }
.copy-link.is-copied .i--check { display: block; color: #3fa66b; }

@media (max-width: 900px) {
  .lb { grid-template-columns: 1fr; grid-template-rows: 56px minmax(0, 1fr) auto; }
  .lb__hint { display: none; }
  .lb__stage { padding: 12px 12px; }
  .lb__nav { width: 40px; height: 40px; }
  .lb__nav--prev { left: 8px; }
  .lb__nav--next { right: 8px; }
  .lb__info { max-height: 40svh; padding: 18px 20px 22px; border-left: 0; border-top: 1px solid rgba(236, 232, 221, 0.08); }
  .lb__title { font-size: 2rem; }
  .exif { grid-template-columns: repeat(3, 1fr); }
  .exif > div.wide { grid-column: span 3; }
}
