/* ============================================================
   Baitz Photography — best-of-both demo
   Warm paper · warm ink · terracotta accent
   Newsreader (display serif) · Space Mono (technical labels)
   ============================================================ */

:root {
  --paper:  #f4efe7;   /* warm gallery paper (tweakable) */
  --ink:    #1a1813;   /* warm near-black */
  --ink-70: #54504733;
  --ink-60: #6b665b;
  --ink-40: #9a948700;
  --muted:  #8d8678;
  --hair:   #ddd6c9;
  --accent: #b8553a;   /* terracotta (tweakable) */

  --cols: 3;
  --gap: 30px;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --mono:  "Space Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1, "liga" 1;
  transition: background .4s var(--ease), color .4s var(--ease);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: color-mix(in oklab, var(--accent) 24%, transparent); }

/* paper grain — sits behind everything; photos & text cover it */
body.grain {
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScyMjAnIGhlaWdodD0nMjIwJz48ZmlsdGVyIGlkPSduJz48ZmVUdXJidWxlbmNlIHR5cGU9J2ZyYWN0YWxOb2lzZScgYmFzZUZyZXF1ZW5jeT0nMC42NScgbnVtT2N0YXZlcz0nMicgc3RpdGNoVGlsZXM9J3N0aXRjaCcvPjwvZmlsdGVyPjxyZWN0IHdpZHRoPScxMDAlJyBoZWlnaHQ9JzEwMCUnIGZpbHRlcj0ndXJsKCNuKScgb3BhY2l0eT0nMC40Jy8+PC9zdmc+");
  background-repeat: repeat;
  background-attachment: fixed;
}

/* ---------- type primitives ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 400;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--muted);
}
.meta {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--muted);
}

/* ---------- shell ---------- */
.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 60px); }
main { display: block; }

/* ---------- masthead ---------- */
.masthead { text-align: center; padding: clamp(48px, 9vw, 104px) 0 clamp(30px, 4vw, 46px); }
.masthead .eyebrow { display: block; margin-bottom: 16px; }
.wordmark {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3.4rem, 11vw, 7.2rem);
  line-height: .9;
  letter-spacing: clamp(.04em, 1.4vw, .16em);
  margin: 0;
  text-indent: clamp(.04em, 1.4vw, .16em); /* optical center for tracking */
}

/* ---------- intro ---------- */
.intro { text-align: center; max-width: 60ch; margin: clamp(26px, 4vw, 44px) auto 0; }
.intro .tagline {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
.intro .lede {
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.85;
  letter-spacing: .01em;
  color: var(--ink-60);
  margin: 18px auto 0;
  max-width: 52ch;
}

/* ---------- filter / nav row ---------- */
.filters {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline;
  gap: clamp(14px, 2.4vw, 30px);
  margin: clamp(40px, 6vw, 70px) 0 clamp(26px, 3vw, 36px);
}
.filters button {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: none; border: 0; cursor: pointer; padding: 4px 0;
  color: var(--muted);
  position: relative;
  transition: color .25s var(--ease);
}
.filters button:hover { color: var(--ink); }
.filters button.active { color: var(--ink); }
.filters button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px;
  height: 1.5px; background: var(--accent);
}

/* ---------- section label (hairline divider) ---------- */
.sectionbar {
  display: flex; align-items: center; gap: 22px;
  margin-bottom: clamp(26px, 3.4vw, 40px);
}
.sectionbar .label { white-space: nowrap; }
.sectionbar .rule { flex: 1; height: 1px; background: var(--hair); }
.sectionbar .count { white-space: nowrap; color: var(--ink); }

/* ---------- masonry grid ---------- */
.grid { column-count: var(--cols); column-gap: var(--gap); }
@media (max-width: 940px) { .grid { column-count: 2; } }
@media (max-width: 560px) { .grid { column-count: 1; } }

.card {
  break-inside: avoid;
  margin: 0 0 calc(var(--gap) + 16px);
  cursor: zoom-in;
  display: block;
  animation: rise .6s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card .frame {
  position: relative; overflow: hidden; background: var(--hair);
}
.card .frame img {
  width: 100%; height: auto;
  opacity: 0;
  transition: opacity .7s var(--ease), transform 1s var(--ease), filter .5s var(--ease);
  will-change: transform;
}
.card .frame img.loaded { opacity: 1; }

/* series cards (more than one photo) get a subtle stacked-paper edge */
.card.series .frame { box-shadow: 5px 5px 0 0 var(--paper), 6px 6px 0 0 var(--hair), 10px 10px 0 0 var(--paper), 11px 11px 0 0 var(--hair); }
@media (max-width: 560px) { .card.series .frame { box-shadow: 4px 4px 0 0 var(--paper), 5px 5px 0 0 var(--hair); } }

/* hover treatments */
body[data-hover="zoom"] .card:hover .frame img { transform: scale(1.045); }
body[data-hover="lift"] .card { transition: transform .5s var(--ease); }
body[data-hover="lift"] .card .frame { transition: box-shadow .5s var(--ease); }
body[data-hover="lift"] .card:hover { transform: translateY(-5px); }
body[data-hover="lift"] .card:hover .frame { box-shadow: 0 22px 46px -24px rgba(20,18,12,.5); }

.card .cap {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding-top: 13px;
  transition: opacity .3s var(--ease);
}
body[data-caps="hover"] .card .cap { opacity: 0; }
body[data-caps="hover"] .card:hover .cap { opacity: 1; }
.card .cap h3 {
  font-family: var(--serif); font-weight: 400; font-size: 1.08rem; line-height: 1.2;
  margin: 0; letter-spacing: -.005em;
  transition: color .25s var(--ease);
}
.card:hover .cap h3 { color: var(--accent); }
.card .cap .where { text-align: right; flex-shrink: 0; }

/* ---------- footer / about ---------- */
.foot { border-top: 1px solid var(--hair); margin-top: clamp(80px, 11vw, 150px); }
.foot .wrap { padding-top: clamp(48px, 6vw, 76px); padding-bottom: clamp(40px, 5vw, 60px); }
.foot-grid {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(30px, 6vw, 90px);
  align-items: start;
}
@media (max-width: 720px) { .foot-grid { grid-template-columns: 1fr; gap: 40px; } }
.foot h2 {
  font-family: var(--serif); font-weight: 300; font-style: italic;
  font-size: clamp(1.5rem, 3vw, 2rem); line-height: 1.2; margin: 0 0 16px;
}
.foot p { font-size: 1rem; line-height: 1.65; color: var(--ink-60); margin: 0 0 1em; max-width: 46ch; }
.foot .contact { font-family: var(--mono); font-size: .76rem; line-height: 2.1; letter-spacing: .02em; }
.foot .contact a { border-bottom: 1px solid var(--hair); transition: color .2s var(--ease), border-color .2s var(--ease); }
.foot .contact a:hover { color: var(--accent); border-color: var(--accent); }
.foot .contact .k { color: var(--muted); display: inline-block; width: 88px; }
.colophon {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  margin-top: clamp(50px, 7vw, 84px);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .06em; color: var(--muted);
}

/* ---------- lightbox ---------- */
.lb {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(16,14,11,.95);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
}
.lb.open { opacity: 1; pointer-events: auto; }
.lb figure { margin: 0; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.lb img { max-width: 90vw; max-height: 78vh; object-fit: contain; box-shadow: 0 40px 90px -34px rgba(0,0,0,.8); }
.lb figcaption { text-align: center; display: flex; flex-direction: column; gap: 6px; }
.lb figcaption .t { font-family: var(--serif); font-style: italic; font-weight: 300; color: #f4efe7; font-size: 1.15rem; }
.lb figcaption .m { font-family: var(--mono); font-size: .72rem; letter-spacing: .08em; color: rgba(244,239,231,.55); }
.lb-btn {
  position: fixed; top: 0; bottom: 0; width: 17vw; min-width: 78px;
  background: none; border: 0; cursor: pointer; color: rgba(244,239,231,.5);
  display: flex; align-items: center; transition: color .2s var(--ease); z-index: 2;
}
.lb-btn:hover { color: #fff; }
.lb-btn.prev { left: 0; justify-content: flex-start; padding-left: 3vw; }
.lb-btn.next { right: 0; justify-content: flex-end; padding-right: 3vw; }
.lb-btn svg { width: 30px; height: 30px; }
.lb-top {
  position: fixed; top: 24px; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: space-between; padding: 0 clamp(20px, 4vw, 40px);
  font-family: var(--mono); font-size: .72rem; letter-spacing: .16em; color: rgba(244,239,231,.6);
}
.lb-top button { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; letter-spacing: .16em; }
.lb-top button:hover { color: #fff; }
.lb-desc {
  position: fixed; top: 58px; left: 0; right: 0; z-index: 2;
  text-align: center; margin: 0 auto; padding: 0 clamp(20px, 6vw, 80px);
  max-width: 64ch; font-family: var(--serif); font-style: italic; font-weight: 300;
  font-size: clamp(.95rem, 1.6vw, 1.15rem); line-height: 1.5; color: rgba(244,239,231,.7);
}
@media (max-width: 640px) { .lb-desc { display: none; } }

/* ---------- corner nav link (home ⇄ about) ---------- */
.corner-link {
  position: fixed; top: clamp(16px, 2.6vw, 26px); right: clamp(18px, 3vw, 34px); z-index: 50;
  font-family: var(--mono); font-size: .72rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); padding: 4px 0; transition: color .2s var(--ease);
}
.corner-link:hover { color: var(--accent); }
.foot-about {
  font-family: var(--mono); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); transition: color .2s var(--ease);
}
.foot-about:hover { color: var(--accent); }

/* ---------- about page ---------- */
.about-page {
  max-width: 62ch; margin: clamp(20px, 4vw, 40px) auto clamp(60px, 10vw, 120px);
  padding: 0 clamp(4px, 2vw, 20px);
}
.about-title {
  font-family: var(--serif); font-weight: 300; font-style: italic;
  font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 clamp(24px, 4vw, 40px);
  letter-spacing: -.01em; text-align: center; text-wrap: balance;
}
.about-portrait {
  display: block; width: 100%; height: auto; margin: 0 0 clamp(28px, 4vw, 44px);
  background: var(--hair);
}
.about-prose { font-size: 1.12rem; line-height: 1.72; color: var(--ink); }
.about-prose p { margin: 0 0 1.15em; }
.about-prose h2, .about-prose h3 {
  font-family: var(--serif); font-weight: 400; font-style: italic;
  margin: 1.6em 0 .5em; line-height: 1.2;
}
.about-prose a { border-bottom: 1px solid var(--hair); transition: color .2s var(--ease), border-color .2s var(--ease); }
.about-prose a:hover { color: var(--accent); border-color: var(--accent); }
