/* ============================================================
   Lee Sagi — Photography
   Neutral monochrome chrome. No hue anywhere in the interface —
   the only color on the page comes from the photographs.
   ============================================================ */

:root {
  --bg: #0f0f0f;
  --header-bg: rgba(15, 15, 15, 0.86);
  --surface: #171717;

  --text: #f2f2f2;
  --text-muted: #8d8d8d;
  --text-faint: #606060;

  /* Hierarchy comes from weight, size and spacing, not hue. */
  --hover: #ffffff;
  --rule: rgba(255, 255, 255, 0.10);
  --rule-strong: rgba(255, 255, 255, 0.28);

  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --maxw: 1560px;
  --header-h: 4.5rem;
  --grid-gap: 16px; /* must match MASONRY_GAP in script.js */

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  /* .section-head supplies 3.75rem of its own top padding, so the anchor
     offset only needs the small remainder. Adjust if that padding changes. */
  scroll-padding-top: 1.25rem;
}

section[id], footer[id] {
  scroll-margin-top: 1.25rem;
}

body {
  margin: 0;
  background-color: var(--bg);
  background-image: var(--grain);
  background-repeat: repeat;
  background-size: 1400px 1400px;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--hover);
  outline-offset: 3px;
}

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--rule);
  background-color: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  padding-block: 0.9rem;
}

.header-brand {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  min-width: 0;
}

.wordmark-link {
  text-decoration: none;
  color: inherit;
  line-height: 1;
  transition: opacity 0.15s ease;
}

.wordmark-link:hover { opacity: 0.7; }

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.45rem, 2.2vw, 1.85rem);
  letter-spacing: -0.005em;
  line-height: 1;
  color: var(--text);
  white-space: nowrap;
}

.tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  border-left: 1px solid var(--rule);
  padding-left: 1rem;
}

/* Nav — affordance via underline + brightness, no color shift */

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.65rem;
}

.nav-link {
  position: relative;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.25rem 0;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav-link-btn {
  background: none;
  border: none;
  margin: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background-color: var(--hover);
  transition: width 0.22s ease;
}

.nav-link:hover,
.nav-link:focus-visible { color: var(--hover); }

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

.nav-link-ext {
  color: var(--text);
  border: 1px solid var(--rule);
  padding: 0.4rem 0.7rem;
}

.nav-link-ext::after { display: none; }

.nav-link-ext:hover { border-color: var(--rule-strong); }

/* ============================================================
   Section headings
   ============================================================ */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 2.5rem 1rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.75rem;
}

.section-label {
  margin: 0;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stats-line {
  margin: 0;
  color: var(--text-faint);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.eyebrow {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 0.5rem;
}

/* ============================================================
   Hero — full bleed. Height is set by the viewport and the image
   covers it, so pillarboxing is structurally impossible.
   ============================================================ */

.hero-section { margin-bottom: 1rem; }

.hero-frame {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(360px, 58vh, 640px);
  background: #0a0a0a;
  overflow: hidden;
  cursor: pointer;
}

.hero-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hero-frame:hover img { transform: scale(1.02); }

.hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.35) 34%, rgba(0,0,0,0) 62%),
    linear-gradient(to right, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0) 55%);
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding-bottom: clamp(1.5rem, 3vw, 2.75rem);
}

.hero-overlay-inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
}

.hero-overlay-text { min-width: 0; max-width: 46ch; }

.hero-desc {
  margin: 0.6rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
}

.hero-meta {
  margin: 0.35rem 0 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}

.hero-meta .dot { padding: 0 0.4rem; }

.hero-expand-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.2rem;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.hero-expand-btn:hover {
  background: #fff;
  border-color: #fff;
  color: #0f0f0f;
}

.btn-arrow { transition: transform 0.2s ease; }
.hero-expand-btn:hover .btn-arrow { transform: translateX(4px); }

/* ============================================================
   Collections
   Standalone component — deliberately shares NO classes with
   .gallery-item so the two can't collide in the cascade.
   ============================================================ */

.album-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2.25rem var(--grid-gap);
  padding-bottom: 1rem;
}

.album-item {
  display: block;
  text-decoration: none;
  color: inherit;
}

.album-item img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid var(--rule);
  transition: border-color 0.25s ease, opacity 0.25s ease;
}

.album-item:hover img,
.album-item:focus-visible img {
  border-color: var(--rule-strong);
  opacity: 0.88;
}

/* Caption below the cover — the photo is never darkened. */
.album-item .item-caption {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-top: 0.85rem;
}

.album-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
  transition: opacity 0.2s ease;
}

.album-item:hover .album-name { opacity: 0.72; }

.album-count {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ---- OPTIONAL: names over the cover instead of beneath it.
   Uncomment this block to switch. Costs you the bottom third
   of every cover image; that's the trade.

.album-item { position: relative; }
.album-item .item-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 1rem 1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}
.album-name, .album-count { color: #fff; }
---- */

/* ============================================================
   Photo grid (masonry)
   ============================================================ */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  grid-auto-rows: 4px; /* must match MASONRY_ROW_UNIT in script.js */
  gap: var(--grid-gap);
  padding-bottom: 5rem;
}

.gallery-item {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--rule);
  cursor: pointer;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease, border-color 0.2s ease;
}

.gallery-item.is-visible { opacity: 1; transform: translateY(0); }

.gallery-item:hover,
.gallery-item:focus-visible { border-color: var(--rule-strong); }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-item:hover img,
.gallery-item:focus-visible img { transform: scale(1.025); }

.item-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem 1.1rem;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.25) 38%, transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.gallery-item:hover .item-overlay,
.gallery-item:focus-visible .item-overlay { opacity: 1; }

.overlay-bottom { display: flex; flex-direction: column; gap: 0.2rem; }

.overlay-caption { font-size: 0.88rem; font-weight: 500; color: var(--text); }

.overlay-meta {
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  color: rgba(255, 255, 255, 0.6);
  font-variant-numeric: tabular-nums;
}

/* ============================================================
   Album view
   ============================================================ */

.album-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding-block: 1.35rem 0.9rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 1.25rem;
}

.album-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(0.95rem, 1.1vw, 1.1rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
  color: var(--text);
}

.back-link {
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.empty-state {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 4rem var(--gutter);
  color: var(--text-muted);
}

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

.site-footer {
  border-top: 1px solid var(--rule);
  margin-top: 2rem;
  padding-block: 3.5rem 2rem;
  background: rgba(0, 0, 0, 0.25);
}

.footer-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 2fr) minmax(200px, 1fr);
  gap: 2.5rem 4rem;
  align-items: start;
}

.footer-logo {
  height: 132px;
  width: auto;
  display: block;
  opacity: 0.92;
}

.footer-col .section-label { display: block; margin-bottom: 1rem; }

.footer-about p {
  margin: 0 0 0.9rem;
  max-width: 62ch;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.footer-gear { font-size: 0.85rem !important; color: var(--text-faint) !important; }

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

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

.footer-bottom {
  padding-top: 2.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--rule);
  color: var(--text-faint);
  font-size: 0.78rem;
}

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

.lightbox {
  position: fixed;
  inset: 0;
  background-color: rgba(8, 8, 8, 0.97);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 2rem;
}

.lightbox[hidden] { display: none; }

.lb-image { max-width: 94vw; max-height: 84vh; object-fit: contain; }

.lb-meta-box { margin-top: 1.25rem; text-align: center; }

.lb-caption { margin: 0; color: var(--text); font-size: 0.95rem; }

.lb-exif {
  margin: 0 0 0.35rem;
  color: var(--text-faint);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  min-height: 1.1rem;
  line-height: 1.1rem;
}

.lb-close, .lb-nav, .lb-mute {
  position: absolute;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.5rem 1rem;
  font-size: 2rem;
  line-height: 1;
  transition: color 0.15s ease;
}

.lb-close { top: 1.5rem; right: 2rem; }
.lb-mute  { top: 1.5rem; left: 2rem; font-size: 1.35rem; }
.lb-prev  { left: 1rem;  top: 50%; transform: translateY(-50%); font-size: 2.75rem; }
.lb-next  { right: 1rem; top: 50%; transform: translateY(-50%); font-size: 2.75rem; }

.lb-close:hover, .lb-nav:hover, .lb-mute:hover { color: var(--hover); }

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

@media (max-width: 1200px) {
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

@media (max-width: 900px) {
  .header-inner { align-items: flex-start; }
  .header-brand { flex-direction: column; gap: 0.3rem; }
  .tagline { border-left: none; padding-left: 0; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-logo { height: 96px; }
}

@media (max-width: 700px) {
  :root { --header-h: 4rem; }

  .header-nav {
    gap: 1.15rem;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 0.2rem;
    scrollbar-width: none;
  }
  .header-nav::-webkit-scrollbar { display: none; }

  .tagline { display: none; }

  .hero-frame { height: clamp(300px, 46vh, 420px); }
  .hero-overlay-inner { flex-direction: column; align-items: stretch; gap: 1.1rem; }
  .hero-expand-btn { justify-content: space-between; }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.75rem var(--grid-gap); }
  .photo-grid { grid-template-columns: 1fr; }
  .section-head { padding-block: 2rem 0.9rem; }

  .lightbox { padding: 1rem; }
  .lb-image { max-width: calc(100vw - 2rem); max-height: 68vh; }
  .lb-nav { font-size: 2rem; padding: 0.5rem; }
  .lb-close { top: 1rem; right: 1rem; }
  .lb-mute { top: 1rem; left: 1rem; }
}

/* ============================================================
   Touch devices
   No hover, so anything hover-gated has to be shown or removed.
   Keyed on the input method, not screen width, so it also covers
   touchscreen laptops and tablets in landscape.
   ============================================================ */

@media (hover: none) {
  /* Captions/EXIF would otherwise be unreachable on a phone. */
  .item-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.2) 32%, transparent 60%);
  }

  /* Nothing to reveal, so drop the transforms that fire on tap. */
  .gallery-item:hover img,
  .album-item:hover img,
  .hero-frame:hover img { transform: none; }
  .album-item:hover img { opacity: 1; }

  /* Bigger tap targets in the lightbox. */
  .lb-close, .lb-nav, .lb-mute { padding: 0.75rem 1rem; }
  .lb-prev { left: 0.25rem; }
  .lb-next { right: 0.25rem; }

  .hero-expand-btn { background: rgba(0, 0, 0, 0.5); }
}

/* Very large displays / TV: let the grid keep filling the screen
   instead of leaving 60% of a 4K panel black. */
@media (min-width: 1900px) {
  :root { --maxw: 1880px; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); }
  .album-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .gallery-item { opacity: 1; transform: none; }
}
