/* ============================================
   CARTER FAWCETT — stylesheet
   You shouldn't need to edit this file.
   ============================================ */

:root {
  --ink:    #0a0a0b;
  --paper:  #efefec;
  --muted:  #7c7c82;
  --rule:   #1e1e22;
  --hi:     #ffffff;

  --gutter: clamp(1.15rem, 3vw, 3rem);
  --maxw:   1800px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

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

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

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

/* ---------- header ---------- */

.masthead {
  /* vertical only — .wrap owns the left/right gutter. Using the padding
     shorthand here would zero it out. */
  padding-top: clamp(1.75rem, 4vw, 2.75rem);
  padding-bottom: clamp(1rem, 2.2vw, 1.5rem);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;      /* nav drops to sit just above the rule */
  justify-content: space-between;
  gap: 0.75rem clamp(1.5rem, 3vw, 3rem);
  border-bottom: 1px solid var(--rule);
}

.mast-id { flex: 0 1 auto; }

.wordmark {
  display: inline-block;
  font-size: clamp(1.4rem, 3.6vw, 2.4rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
}

.tagline {
  margin: 0.85rem 0 0;
  font-family: "DM Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-size: clamp(0.68rem, 0.95vw, 0.8rem);
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem clamp(0.7rem, 1.2vw, 1.15rem);
  padding-top: 0;
  margin-left: auto;
  justify-content: flex-end;
}

.nav a {
  font-family: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(0.6rem, 0.72vw, 0.7rem);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.3rem 0;
  transition: color 0.25s ease;
}

.nav a:hover,
.nav a[aria-current="page"] { color: var(--paper); }

/* ---------- page title ---------- */

.page-title {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.008em;
  margin: clamp(1.1rem, 2.6vw, 2rem) 0 clamp(1.25rem, 3vw, 2rem);
}

/* ---------- works grid ---------- */

.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.5rem, 1.3vw, 1.15rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

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

/* landing page has no heading, so the grid needs its own breathing room */
.grid--top { margin-top: clamp(1.1rem, 2.4vw, 1.85rem); }

.tile { display: block; }

.tile-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #131316;
}

.tile-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.82) saturate(0.9);
  transform: scale(1.001);
  transition: filter 0.5s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tile:hover .tile-frame img,
.tile:focus-visible .tile-frame img {
  filter: brightness(1) saturate(1);
  transform: scale(1.03);
}

/* title rides over the frame and fades in on hover */
.tile-caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(0.9rem, 2vw, 1.5rem);
  /* even wash rather than a bottom gradient, since the title sits centred */
  background: rgba(0, 0, 0, 0.42);
  opacity: 0;
  transition: opacity 0.35s ease;
}

.tile-title {
  margin: 0;
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--hi);
  max-width: 22ch;
  line-height: 1.35;
  text-wrap: balance;
  transform: translateY(6px);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tile:hover .tile-caption,
.tile:focus-visible .tile-caption { opacity: 1; }

.tile:hover .tile-title,
.tile:focus-visible .tile-title { transform: translateY(0); }

/* touch devices have no hover — keep titles visible there */
@media (hover: none) {
  .tile-caption { opacity: 1; }
  .tile-title { transform: none; }
}

.tile-meta {
  margin: 0.25rem 0 0;
  font-family: "DM Mono", ui-monospace, Menlo, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- project page ---------- */

.player {
  position: relative;
  aspect-ratio: 16 / 9;   /* starting point; corrected to the real ratio at load */
  background: #000;       /* black, not grey — any residual bar reads as letterbox */
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
  transition: aspect-ratio 0.3s ease;
}

@media (prefers-reduced-motion: reduce) {
  .player { transition: none; }
}

.player iframe,
.player img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;   /* never crop the frame */
}

.player-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: "DM Mono", ui-monospace, Menlo, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding: 1rem;
}

.project-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
  margin: clamp(1.5rem, 4vw, 3rem) 0 clamp(1.5rem, 3.5vw, 2.25rem);
}

.project-head h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 500;
  letter-spacing: -0.008em;
}

/* credits — set like a camera report */
.credits {
  margin: clamp(1.75rem, 4vw, 2.5rem) 0 clamp(3rem, 8vw, 6rem);
  font-family: "DM Mono", ui-monospace, Menlo, monospace;
  font-size: 0.76rem;
  line-height: 2.1;
  letter-spacing: 0.03em;
  color: var(--muted);
  max-width: 46rem;
}

.credit-row {
  display: grid;
  grid-template-columns: minmax(9rem, 15rem) 1fr;
  gap: 0 1.5rem;
  border-bottom: 1px solid var(--rule);
  padding: 0.15rem 0;
}

.credit-row dt {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.66rem;
  color: #5a5a60;
  align-self: center;
}

.credit-row dd { margin: 0; color: var(--paper); }

.credit-note {
  padding-top: 1.25rem;
  color: var(--muted);
}

@media (max-width: 560px) {
  .credit-row { grid-template-columns: 1fr; gap: 0; padding: 0.5rem 0; }
  .credit-row dt { line-height: 1.6; }
}

/* ---------- contact ---------- */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: clamp(3rem, 8vw, 6rem);
}

@media (min-width: 860px) {
  .contact-layout { grid-template-columns: 1.1fr 1fr; }
}

.contact-portrait { background: #131316; }

.contact-block p { margin: 0 0 0.4rem; }

.email-link {
  display: inline-block;
  font-size: clamp(1.15rem, 2.6vw, 1.6rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.2rem;
  margin-bottom: 1.5rem;
  transition: border-color 0.25s ease;
}

.email-link:hover { border-color: var(--paper); }

.label {
  font-family: "DM Mono", ui-monospace, Menlo, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #5a5a60;
  margin: 2.25rem 0 0.85rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
}

.link-list { list-style: none; margin: 0; padding: 0; }

.link-list li { margin-bottom: 0.55rem; }

.link-list a {
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.link-list a:hover { color: var(--paper); border-bottom-color: var(--rule); }

/* ---------- footer ---------- */

.footer {
  border-top: 1px solid var(--rule);
  padding-top: 2rem;
  padding-bottom: 3.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem clamp(1rem, 2.4vw, 2.25rem);
  font-family: "DM Mono", ui-monospace, Menlo, monospace;
  font-size: clamp(0.66rem, 0.9vw, 0.76rem);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.footer a { transition: color 0.25s ease; }
.footer a:hover { color: var(--paper); }

.footer .spacer { margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .tile:hover .tile-frame img { transform: none; }
  .tile-title { transform: none; }
}

/* trailing mark on page headings */
.tm {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ---------- multiple videos on one project ---------- */

.player-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

@media (min-width: 820px) {
  .player-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.player-grid .player { margin-bottom: 0; }

.player-label {
  margin: 0.7rem 0 0;
  font-family: "DM Mono", ui-monospace, Menlo, monospace;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Instagram glyph, right side of nav */
.nav-ig {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  padding: 0.35rem 0;
  transition: color 0.25s ease;
}

.nav-ig:hover { color: var(--paper); }

.nav-ig svg {
  width: clamp(15px, 1.2vw, 17px);
  height: clamp(15px, 1.2vw, 17px);
  display: block;
}

/* ---------- frame grabs ---------- */

.stills-grid {
  /* masonry: frames keep their native shape and tile flush, columns run ragged */
  columns: 3;
  column-gap: 0;
  margin: clamp(2rem, 4vw, 2.75rem) 0 clamp(1.5rem, 3vw, 2rem);
}

@media (max-width: 900px) { .stills-grid { columns: 2; } }
@media (max-width: 560px) { .stills-grid { columns: 1; } }

.still {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  line-height: 0;
  cursor: zoom-in;
  appearance: none;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

.still img {
  width: 100%;
  height: auto;          /* native aspect ratio, never cropped */
  display: block;
  filter: brightness(0.82) saturate(0.92);
  transition: filter 0.4s ease;
}

.still:hover img,
.still:focus-visible img {
  filter: brightness(1) saturate(1);
}

/* ---------- lightbox ---------- */

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

.lightbox.on { display: flex; }

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

.lb-stage img {
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  width: auto;
  height: auto;
  object-fit: contain;
}

.lb-close,
.lb-nav {
  position: absolute;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  transition: color 0.25s ease;
}

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

.lb-close {
  top: clamp(0.75rem, 2.5vw, 1.5rem);
  right: clamp(0.75rem, 2.5vw, 1.5rem);
  font-size: 2rem;
  padding: 0.4rem 0.7rem;
}

.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.6rem;
  padding: 0.5rem 0.9rem;
}

.lb-prev { left: clamp(0.25rem, 1.5vw, 1.25rem); }
.lb-next { right: clamp(0.25rem, 1.5vw, 1.25rem); }

@media (max-width: 600px) {
  .lb-nav { font-size: 2rem; }
  .lb-stage img { max-height: calc(100vh - 11rem); }
}

/* once the nav wraps under the wordmark, right-alignment reads ragged */
@media (max-width: 780px) {
  .nav {
    justify-content: flex-start;
    margin-left: 0;
    width: 100%;
    padding-top: 0.75rem;
  }
}
