/* ============================================================
   Joseph Foley — editorial portfolio
   ============================================================ */

:root {
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --rule: #d8d4cc;
  --paper: #f4f1ea;
  --paper-soft: #ebe7df;
  --accent: #1a1a1a;
  --serif: "Cormorant Garamond", "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
  --frame-pad: clamp(1.25rem, 3.5vw, 3rem);
  --frame-inset: clamp(0.75rem, 2vw, 1.75rem);
  --section-gap: clamp(4rem, 9vw, 8rem);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-weight: 300;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; height: auto; }

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

/* ---------- Frame (Jeremy Folk-style inner border) ---------- */

.frame {
  min-height: 100vh;
  padding: var(--frame-pad);
  position: relative;
}

/* .frame::before — removed (page border) */

/* ---------- Nav ---------- */

.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(244, 241, 234, 0.85);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--rule);
  margin: calc(var(--frame-pad) * -1) calc(var(--frame-pad) * -1) 0;
  padding-left: var(--frame-pad);
  padding-right: var(--frame-pad);
}

.nav__brand {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.nav__links {
  display: flex;
  gap: 2rem;
}

.nav__links a {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.3s ease;
  position: relative;
  padding-bottom: 2px;
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--ink);
}

.nav__links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -4px;
  height: 1px;
  background: var(--ink);
}

/* ---------- Eyebrow + section label ---------- */

.eyebrow,
.section-label {
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 400;
}

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

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  padding: clamp(2rem, 6vw, 5rem) 1.5rem clamp(3rem, 8vw, 6rem);
  min-height: calc(100vh - 12rem);
  position: relative;
  z-index: 2;
}

.hero__text {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
  padding: 0;
}

.hero__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(3.5rem, 9vw, 7.5rem);
  line-height: 0.95;
  letter-spacing: -0.01em;
  margin-top: 0.5rem;
  text-align: center;
}

.hero__lede {
  font-size: 0.95rem;
  color: var(--ink-soft);
  max-width: 28ch;
  line-height: 1.7;
}

.btn {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  padding: 1rem 2.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 500;
  transition: background 0.3s ease, transform 0.3s ease;
  margin-top: 1rem;
}

.btn:hover {
  background: #000;
  transform: translateY(-1px);
}

.btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
  padding: calc(1rem - 1px) calc(2.5rem - 1px);
}

.btn--outline:hover {
  background: var(--ink);
  color: var(--paper);
}

.hero__cta {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

.hero__handle {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.5rem;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.hero__handle:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.hero__image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero__image img {
  width: 100%;
  max-width: 540px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center;
}

/* ---------- Demo Reel ---------- */

.reel {
  padding: var(--section-gap) 1.5rem;
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--rule);
  text-align: center;
}

.reel .section-label { display: block; margin-bottom: 2.5rem; }

.reel__frame {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  background: var(--paper-soft);
}

.reel__embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.reel__embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.reel__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.75);
  font-size: 0.85rem;
  pointer-events: none;
  text-align: center;
  padding: 1rem;
}

.reel__placeholder p { margin: 0; }

.reel__placeholder--small { font-size: 0.7rem; }

.reel__hint { font-size: 0.7rem; opacity: 0.6; max-width: 40ch; }

.reel__embed code {
  background: rgba(255,255,255,0.1);
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  font-size: 0.75em;
}

.reel__embed iframe[src="about:blank"] + .reel__placeholder { display: flex; }
.reel__embed iframe:not([src="about:blank"]) + .reel__placeholder { display: none; }

/* ---------- Featured (gallery teaser) ---------- */

.featured {
  padding: var(--section-gap) 1.5rem;
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--rule);
}

.featured__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3rem;
  gap: 1rem;
}

.link-arrow {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  padding-bottom: 2px;
  transition: opacity 0.3s ease;
}

.link-arrow:hover { opacity: 0.55; }

.featured__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

.featured__tile {
  display: block;
  overflow: hidden;
}

.featured__tile img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.8s ease;
}

.featured__tile:hover img { transform: scale(1.04); }

/* ---------- Contact ---------- */

.contact {
  padding: var(--section-gap) 1.5rem;
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--rule);
}

.contact .section-label { display: block; margin-bottom: 2.5rem; }

.contact__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem;
}

.contact__col { display: flex; flex-direction: column; gap: 0.5rem; }

.contact__label {
  font-size: 0.65rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.contact__value {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--ink);
  transition: opacity 0.3s ease;
  display: inline-block;
  width: fit-content;
}

a.contact__value:hover { opacity: 0.55; }

.contact__bbbs {
  margin-top: 3.5rem;
  padding: 2rem 2.25rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 720px;
}

.contact__bbbs .contact__label { margin-bottom: 0.25rem; }

.bbbs__title {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--ink);
  margin: 0;
}

.bbbs__note {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 0;
}

.contact__bbbs .link-arrow {
  align-self: flex-start;
  margin-top: 0.5rem;
}

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

.foot {
  padding: 2rem 1.5rem 0.5rem;
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  z-index: 2;
}

/* ---------- Page head (gallery, media) ---------- */

.page-head {
  padding: clamp(2rem, 6vw, 4rem) 1.5rem clamp(2rem, 4vw, 3rem);
  text-align: center;
  position: relative;
  z-index: 2;
}

.page-head .eyebrow { margin-bottom: 1rem; }

.page-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: -0.01em;
  line-height: 1;
}

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

.gallery-banner {
  position: relative;
  margin: 0 1.5rem clamp(2rem, 5vw, 4rem);
  overflow: hidden;
  height: clamp(360px, 60vh, 640px);
}

.gallery-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  display: block;
}

.gallery-banner__caption {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: linear-gradient(to top, rgba(11, 13, 17, 0.55) 0%, rgba(11, 13, 17, 0) 60%);
  color: var(--cream, #F0EDE8);
  text-align: center;
}

.gallery-banner__caption .eyebrow {
  color: rgba(240, 237, 232, 0.8);
  margin-bottom: 0.75rem;
}

.gallery-banner__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  letter-spacing: -0.01em;
  line-height: 1;
  color: var(--cream, #F0EDE8);
  margin: 0;
}

/* ---------- Gallery (tabbed + lightbox) ---------- */

.gallery-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  padding: 0 1.5rem 2.5rem;
  border-bottom: 1px solid var(--rule);
  margin-bottom: clamp(2rem, 5vw, 4rem);
}

.gallery-tab {
  appearance: none;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 0 0 6px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
}

.gallery-tab::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.gallery-tab:hover { color: var(--ink); }

.gallery-tab.is-active {
  color: var(--ink);
  font-weight: 500;
}

.gallery-tab.is-active::after { transform: scaleX(1); }

.gallery-tab__badge {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  background: var(--ink);
  color: var(--paper);
  padding: 2px 6px;
  border-radius: 2px;
}

.gallery-panel {
  display: none;
  padding: 0 1.5rem clamp(2rem, 5vw, 4rem);
  position: relative;
  z-index: 2;
}

.gallery-panel.is-active { display: block; }

.gallery-panel__note {
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  margin: 0 0 clamp(1.5rem, 3vw, 2.5rem);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.gallery-tile {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  position: relative;
}

.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease, opacity 0.3s ease;
}

.gallery-tile:hover img { transform: scale(1.04); opacity: 0.92; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 17, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: clamp(1rem, 4vw, 3rem);
}

.lightbox.is-open { display: flex; }

.lightbox__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: min(900px, 90vw);
  max-height: 90vh;
}

.lightbox__img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

.lightbox__nav,
.lightbox__close {
  appearance: none;
  background: rgba(240, 237, 232, 0.08);
  color: var(--cream, #F0EDE8);
  border: 1px solid rgba(240, 237, 232, 0.25);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lightbox__nav:hover,
.lightbox__close:hover {
  background: rgba(240, 237, 232, 0.18);
  border-color: rgba(240, 237, 232, 0.5);
}

.lightbox__nav { flex-shrink: 0; }

.lightbox__close {
  position: absolute;
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
  font-size: 1.5rem;
  line-height: 1;
}

.lightbox__counter {
  position: absolute;
  bottom: clamp(1rem, 3vw, 2rem);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(240, 237, 232, 0.7);
}

@media (max-width: 720px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .lightbox__nav { width: 40px; height: 40px; }
}

/* ---------- Slideshow ---------- */

.slideshow {
  padding: 1rem 1.5rem clamp(3rem, 6vw, 5rem);
  position: relative;
  z-index: 2;
}

.slideshow__stage {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.slideshow__track {
  flex: 1;
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--paper-soft);
}

.slideshow__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
}

.slideshow__slide.is-active { opacity: 1; }

.slideshow__slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0a0a0a;
}

.slideshow__nav {
  background: transparent;
  border: 1px solid var(--rule);
  width: 44px;
  height: 44px;
  cursor: pointer;
  color: var(--ink);
  font-size: 1rem;
  transition: background 0.3s ease, color 0.3s ease;
  font-family: var(--sans);
}

.slideshow__nav:hover {
  background: var(--ink);
  color: var(--paper);
}

.slideshow__meta {
  max-width: 1100px;
  margin: 1.25rem auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.slideshow__play {
  background: transparent;
  border: none;
  color: var(--ink-soft);
  cursor: pointer;
  font: inherit;
  letter-spacing: 0.22em;
  padding: 0.25rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.slideshow__play:hover,
.slideshow__play.is-on { color: var(--ink); border-color: var(--ink); }

.slideshow__thumbs {
  max-width: 1100px;
  margin: 2rem auto 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0.5rem;
}

.slideshow__thumb {
  cursor: pointer;
  aspect-ratio: 1;
  overflow: hidden;
  opacity: 0.55;
  transition: opacity 0.3s ease;
  background: none;
  border: 0;
  padding: 0;
}

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

.slideshow__thumb:hover { opacity: 0.85; }

.slideshow__thumb.is-active { opacity: 1; outline: 1px solid var(--ink); outline-offset: 2px; }

/* ---------- Media page ---------- */

.media-section {
  padding: clamp(2rem, 5vw, 4rem) 1.5rem;
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--rule);
}

.media-section .section-label {
  display: block;
  margin-bottom: 1.75rem;
}

.media-video {
  max-width: 1000px;
  margin: 0 auto;
  background: #000;
}

.media-video video {
  width: 100%;
  display: block;
}

.media-note {
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--ink-soft);
  text-align: center;
}

.media-note code {
  background: var(--paper-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 2px;
  font-size: 0.9em;
}

.ig-credit {
  margin: clamp(2.5rem, 5vw, 4rem) auto 0;
  max-width: 760px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  align-items: start;
  justify-items: center;
}

.ig-credit .instagram-media { width: 100% !important; min-width: 0 !important; }

@media (max-width: 600px) {
  .ig-credit { grid-template-columns: 1fr; max-width: 360px; }
}

.ig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.instagram-media { margin: 0 auto !important; min-width: 280px !important; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.video-card__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  margin-bottom: 0.75rem;
}

.video-card__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-card__label {
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

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

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    min-height: auto;
    padding-top: 1rem;
  }
  /* image on top, centered text block below — keep alignment consistent with desktop */
  .hero__text { padding: 0; order: 2; align-items: center; text-align: center; }
  .hero__image { order: 1; }
  .hero__image img { max-width: 100%; aspect-ratio: 3 / 4; }
  .hero__cta { width: 100%; }
  .hero__cta .btn { flex: 1 1 auto; text-align: center; }
  .nav { padding: 0.75rem 1.25rem; gap: 0.75rem 1.25rem; flex-wrap: wrap; }
  .nav__links { gap: 1.25rem; }
  .featured__grid,
  .contact__grid,
  .video-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .featured__head { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .foot { flex-direction: column; gap: 0.5rem; align-items: center; }
}
