/* =========================================================
   Director Portfolio — shared stylesheet
   Minimal, clean, artsy. Mobile-first, fully responsive.
   ========================================================= */

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body,
h1,
h2,
h3,
h4,
p,
figure,
blockquote,
ul,
ol {
  margin: 0;
  padding: 0;
}

ul,
ol {
  list-style: none;
}

img,
picture,
video,
iframe {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* ---------- Design tokens ---------- */
:root {
  --bg: #fafaf8;
  --ink: #161616;
  --ink-soft: #555;
  --rule: #e7e5e0;
  --accent: #b85c38; /* warm terracotta — subtle artsy accent */

  --font-sans: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: "Fraunces", "Times New Roman", Georgia, serif;

  --maxw: 1240px;
  --gutter: clamp(1.25rem, 4vw, 3rem);

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ---------- Base ---------- */
html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--ink);
  color: var(--bg);
}

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

/* ---------- Typography ---------- */
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 1.05;
  color: var(--ink);
}

h1 {
  font-size: clamp(2.75rem, 7vw, 5.75rem);
}

h2 {
  font-size: clamp(2rem, 4.5vw, 3.25rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
  font-style: normal;
  font-weight: 500;
  font-family: var(--font-sans);
  letter-spacing: 0;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.lede {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: clamp(1.25rem, 2.2vw, 1.6rem);
  line-height: 1.4;
  color: var(--ink);
  max-width: 48ch;
}

.muted {
  color: var(--ink-soft);
}

/* ---------- Navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
}

.site-header .container {
  max-width: none;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.1rem;
}

.brand {
  font-family: "Pinyon Script", "Segoe Script", cursive;
  font-style: normal;
  font-weight: 400;
  font-size: 2.5rem;
  letter-spacing: 0;
  line-height: 1;
}

.brand a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
}

.nav-list {
  display: flex;
  gap: clamp(3.5rem, 9vw, 8rem);
  align-items: center;
}

.nav-list a {
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  position: relative;
  padding-block: 0.25rem;
  transition: color 0.25s var(--ease);
}

.nav-list a:hover {
  color: var(--ink);
}

.nav-list a[aria-current="page"] {
  color: var(--ink);
}

.nav-toggle {
  display: none;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}

.nav-toggle span {
  position: relative;
}

.nav-toggle span::before {
  position: absolute;
  top: -6px;
  left: 0;
}

.nav-toggle span::after {
  position: absolute;
  top: 6px;
  left: 0;
}

.nav-toggle[aria-expanded="true"] span {
  background: transparent;
}

.nav-toggle[aria-expanded="true"] span::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span::after {
  transform: translateY(-6px) rotate(-45deg);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: inline-flex;
  }

  .nav-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem var(--gutter) 1.25rem;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
  }

  .nav-list.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-list a {
    display: block;
    padding-block: 0.85rem;
    font-size: 1.05rem;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding-block: clamp(4rem, 10vw, 8rem) clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--rule);
}

.hero .eyebrow {
  margin-bottom: 1.25rem;
}

.hero h1 {
  max-width: 14ch;
  margin-bottom: 1.5rem;
}

.hero .lede {
  margin-top: 1rem;
}

.hero-meta {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
  color: var(--ink-soft);
  font-size: 0.85rem;
  letter-spacing: 0.04em;
}

/* ---------- Sections ---------- */
.section {
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
}

.section + .section {
  border-top: 1px solid var(--rule);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  flex-wrap: wrap;
}

.section-head p {
  max-width: 42ch;
  color: var(--ink-soft);
}

/* ---------- Works grid (thumbnail tiles linking to detail pages) ---------- */

/* Break each category section out of the .container so the grid can run
   nearly edge-to-edge of the viewport, like Sabra Binder's portfolio. */
.works-section {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  padding-inline: var(--gutter);
}

.works-section + .works-section {
  margin-top: clamp(3rem, 6vw, 5rem);
}

.works-section__title {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.05;
  color: var(--ink);
  margin-bottom: clamp(1.75rem, 3.5vw, 2.5rem);
}

.works {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(3.5rem, 6vw, 5.5rem) clamp(0.5rem, 0.8vw, 0.8rem);
}

/* On mobile, shrink the side gutters of the works grid so thumbnails
   read larger and feel edge-to-edge. */
@media (max-width: 639.98px) {
  .works-section {
    padding-inline: 0.5rem;
  }

  .works {
    gap: clamp(2.25rem, 8vw, 3.5rem) 0.5rem;
  }
}

/* If a last item is alone on its row, center it. */
@media (min-width: 640px) and (max-width: 979.98px) {
  /* 2-col grid: orphan = 1 leftover */
  .works > .work:last-child:nth-child(2n + 1) {
    grid-column: 1 / span 2;
    justify-self: center;
    width: calc(50% - clamp(0.6rem, 1.1vw, 1.1rem) / 2);
  }
}

@media (min-width: 980px) {
  /* 3-col grid: orphan = 1 leftover → center in middle column */
  .works > .work:last-child:nth-child(3n + 1) {
    grid-column: 2;
  }
}

@media (min-width: 640px) {
  .works {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 980px) {
  .works {
    grid-template-columns: repeat(3, 1fr);
  }
}

.work {
  margin: 0;
}

.work-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #eee;
  border-radius: 2px;
}

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

.work-link:focus-visible .thumb {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.work figcaption {
  margin-top: 1.3rem;
  text-align: center;
}

.work figcaption h3 {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  transition: color 0.25s var(--ease);
}

.work-link:hover figcaption h3 {
  color: var(--accent);
}

.work figcaption .meta {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  text-transform: uppercase;
}

/* ---------- Video wrapper (used on detail pages and OroVerde group) ---------- */
.video {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #111;
  overflow: hidden;
  border-radius: 2px;
}

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

.video--portrait {
  padding-top: 177.78%; /* 9:16 */
}

/* Grouped videos on a detail page (e.g. OroVerde campaign of 4 films) */
.work-group {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 640px) {
  .work-group {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mixed-orientation group: 1 portrait video next to a stack of landscapes. */
.work-group--mixed {
  grid-template-columns: 1fr;
}

@media (min-width: 720px) {
  .work-group--mixed {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.work-group__stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* ---------- Work detail page ---------- */
.work-detail__head {
  padding-block: clamp(3.5rem, 6.5vw, 5rem) 1.75rem;
}

.work-detail__head h1 {
  font-family: var(--font-sans);
  font-style: normal;
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  line-height: 1.3;
  margin-bottom: 0.4rem;
}

.work-detail__head .meta {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.work-detail__video {
  padding-block: 1.25rem 4rem;
}

/* On mobile, let the video span almost edge-to-edge. */
@media (max-width: 639.98px) {
  .work-detail__video .container {
    padding-inline: 0.5rem;
    max-width: none;
  }
}

.work-detail__stills {
  padding-block: clamp(2rem, 4vw, 3rem) clamp(4rem, 7vw, 6rem);
}

.work-detail__stills .container {
  max-width: 1600px;
}

.work-detail__stills .section-head h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

/* ---------- About / bio ---------- */
.bio {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  align-items: start;
}

@media (min-width: 820px) {
  .bio {
    grid-template-columns: 1fr 1.4fr;
  }
}

.bio-portrait {
  aspect-ratio: 3 / 2;
  background: #eee;
  overflow: hidden;
  border-radius: 2px;
}

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

.bio-text p + p {
  margin-top: 1rem;
}

.bio-text .lede {
  margin-bottom: 1.5rem;
}

/* ---------- Photo gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(0.2rem, 0.6vw, 0.4rem);
}

.gallery figure {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #eee;
  border-radius: 2px;
}

.gallery figure.wide {
  aspect-ratio: 4 / 3;
  grid-column: span 2;
}

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

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

.gallery figcaption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0.6rem 0.8rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

.gallery figure:hover figcaption {
  opacity: 1;
  transform: translateY(0);
}

/* On mobile: stack stills one-per-row and let them span almost edge-to-edge,
   matching the wide video player. */
@media (max-width: 639.98px) {
  .work-detail__stills .container {
    padding-inline: 0.5rem;
    max-width: none;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* ---------- Contact ---------- */
.contact {
  padding-block: clamp(4rem, 10vw, 8rem);
}

.contact h1 {
  max-width: 18ch;
  margin-bottom: 1.5rem;
}

.contact-email {
  display: inline-block;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  letter-spacing: -0.01em;
  line-height: 1.1;
  padding-bottom: 0.15em;
  background-image: linear-gradient(var(--ink), var(--ink));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  transition: background-size 0.35s var(--ease);
  word-break: break-word;
}

.contact-email:hover {
  background-size: 0 1px;
}

.contact-grid {
  margin-top: clamp(3rem, 6vw, 4.5rem);
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem 3rem;
}

@media (min-width: 720px) {
  .contact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.contact-block h3 {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.75rem;
}

.contact-block ul {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.contact-block a {
  position: relative;
  display: inline-block;
  padding-block: 0.15rem;
}

.contact-block a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--ink);
  transition: right 0.3s var(--ease);
}

.contact-block a:hover::after {
  right: 0;
}

.contact-block a.social-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0;
  color: var(--ink);
  transition: opacity 0.25s var(--ease);
}

.contact-block a.social-icon::after {
  content: none;
}

.contact-block a.social-icon:hover {
  opacity: 0.6;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 2.5rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.site-footer .inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer--bare {
  border-top: none;
}

.site-footer--bare .inner {
  justify-content: flex-end;
}

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

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  background: rgba(15, 15, 15, 0.94);
  color: #fff;
  align-items: center;
  justify-content: center;
  padding: clamp(0.75rem, 3vw, 2rem);
}

.lightbox.is-open {
  display: flex;
  animation: lightboxFade 0.18s ease-out;
}

@keyframes lightboxFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.lightbox__stage {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.lightbox__stage img {
  max-width: min(96vw, 1600px);
  max-height: 86vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox__counter {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.6;
}

.lightbox__btn {
  position: absolute;
  background: transparent;
  border: 0;
  color: #fff;
  cursor: pointer;
  padding: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s var(--ease);
}

.lightbox__btn:hover,
.lightbox__btn:focus-visible {
  opacity: 1;
  outline: none;
}

.lightbox__btn--close {
  top: clamp(0.5rem, 2vw, 1.25rem);
  right: clamp(0.5rem, 2vw, 1.25rem);
}

.lightbox__btn--prev {
  left: clamp(0.25rem, 2vw, 1.5rem);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__btn--next {
  right: clamp(0.25rem, 2vw, 1.5rem);
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 639.98px) {
  .lightbox__btn--prev,
  .lightbox__btn--next {
    top: auto;
    bottom: 1rem;
    transform: none;
  }
  .lightbox__btn--prev { left: 25%; }
  .lightbox__btn--next { right: 25%; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
