:root {
  --bg: #050505;
  --panel: #0c0c0c;
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: #f5f1e8;
  --muted: rgba(245, 241, 232, 0.68);
  --accent: #d8b36a;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --max-width: 1680px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(216, 179, 106, 0.12), transparent 28%),
    linear-gradient(180deg, #060606 0%, #050505 100%);
  color: var(--text);
  font-family: "Manrope", sans-serif;
}

.showreel-private-page {
  background: #000;
}

.showreel-private-shell {
  width: 100vw;
  height: 100vh;
}

.showreel-private-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}

.showreel-private-back {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5rem;
  min-height: 2.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(5, 5, 5, 0.35);
  color: var(--text);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.74rem;
  backdrop-filter: blur(8px);
}

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

button {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  padding: 1.2rem 1.5rem;
  background: linear-gradient(180deg, rgba(5, 5, 5, 0.82), rgba(5, 5, 5, 0.22), transparent);
}

.nav a {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem;
}

.nav a {
  color: var(--muted);
  transition: color 180ms ease;
}

.nav a.is-active,
.nav a:hover,
.nav a:focus-visible {
  color: var(--text);
}

.page-main {
  padding-top: 5.5rem;
}

.hero {
  position: relative;
  height: 100vh;
  min-height: 680px;
  overflow: clip;
}

.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 24%, transparent 72%, rgba(0, 0, 0, 0.42)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.22), transparent 34%, transparent 66%, rgba(0, 0, 0, 0.18));
  pointer-events: none;
}

.content-section {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

.page-section {
  padding-top: 2rem;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}

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

.project-card {
  grid-column: span 6;
  position: relative;
  border: 0;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
  min-height: auto;
  aspect-ratio: var(--project-aspect-ratio, 16 / 9);
  box-shadow: var(--shadow);
}

body[data-page="commercial"] .project-card.is-triptych {
  grid-column: span 3;
  aspect-ratio: var(--project-aspect-ratio, 9 / 16);
  max-height: min(60vw, 38rem);
  justify-self: center;
  width: 100%;
}

.project-card.is-fallback,
.photo-card.is-fallback {
  background:
    linear-gradient(135deg, rgba(216, 179, 106, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.03);
}

.project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.72));
  pointer-events: none;
}

.project-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.project-preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

body[data-page="commercial"] .project-card.is-triptych img,
body[data-page="commercial"] .project-card.is-triptych .project-preview-video {
  object-fit: cover;
}

.project-preview-slideshow,
.narrative-gallery {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
}

.project-preview-slide,
.narrative-gallery-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  opacity: 0;
  transition: opacity 480ms ease;
}

.project-preview-slide.is-active,
.narrative-gallery-image.is-active {
  opacity: 1;
}

.slideshow-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(5, 5, 5, 0.5);
  color: var(--text);
  transform: translateY(-50%);
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease;
}

.slideshow-arrow.is-prev {
  left: 0.9rem;
}

.slideshow-arrow.is-next {
  right: 0.9rem;
}

.slideshow-arrow:hover,
.slideshow-arrow:focus-visible {
  background: rgba(5, 5, 5, 0.68);
}

.slideshow-arrow.is-prev:hover,
.slideshow-arrow.is-prev:focus-visible,
.slideshow-arrow.is-next:hover,
.slideshow-arrow.is-next:focus-visible {
  transform: translateY(-50%) scale(1.06);
}

.project-logo {
  position: absolute;
  inset: 50% auto auto 50%;
  z-index: 1;
  width: auto;
  max-width: none;
  max-height: none;
  height: auto;
  object-fit: contain;
  opacity: 1;
  pointer-events: none;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.25));
  transform: translate(-50%, -50%) scale(0.25);
  transform-origin: center;
}

body[data-page="commercial"] .project-card.is-triptych .project-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  transform: translate(-50%, -50%) scale(0.9);
  filter: brightness(0) invert(1) drop-shadow(0 10px 25px rgba(0, 0, 0, 0.25));
}

.project-visual-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: inherit;
  padding: 1.5rem;
  color: rgba(245, 241, 232, 0.86);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-button {
  display: block;
  width: 100%;
  height: 100%;
  min-height: inherit;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.project-meta {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-end;
  padding: 1.2rem;
}

body[data-page="commercial"] .project-meta {
  display: none;
}

.project-copy h3,
.project-copy p,
.project-format {
  margin: 0;
}

.project-copy h3 {
  font-size: 1.15rem;
  font-weight: 600;
}

.project-copy p,
.project-format {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.photo-grid {
  columns: 3 280px;
  column-gap: 1rem;
}

.narrative-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(18rem, 0.65fr);
  gap: 1.5rem;
  align-items: start;
}

.narrative-media {
  border: 0;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: var(--shadow);
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

.narrative-media.is-gallery {
  aspect-ratio: 16 / 9;
  padding: 0;
}

.narrative-player,
.narrative-poster {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  background: #000;
}

.narrative-info {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.narrative-kicker {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.detail-list {
  display: grid;
  gap: 0.95rem;
  margin: 0;
}

.detail-row {
  display: grid;
  gap: 0.25rem;
}

.detail-label,
.detail-value {
  margin: 0;
}

.detail-label {
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.detail-value {
  font-size: 1rem;
  line-height: 1.45;
}

.back-link {
  display: inline-flex;
  width: fit-content;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.photo-card {
  break-inside: avoid;
  position: relative;
  margin-bottom: 1rem;
  overflow: hidden;
  border: 0;
  background: rgba(255, 255, 255, 0.02);
  box-shadow: var(--shadow);
}

.photo-card img {
  width: 100%;
  height: auto;
  display: block;
}

.photo-fallback {
  display: grid;
  place-items: center;
  min-height: 18rem;
  padding: 1.5rem;
  color: rgba(245, 241, 232, 0.86);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.empty-state {
  border: 1px solid var(--panel-border);
  padding: 1.4rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.02);
}

.contact-section {
  min-height: 40vh;
  display: grid;
  justify-items: center;
  align-content: start;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 9.5rem;
  min-height: 2.8rem;
  padding: 0.72rem 0.95rem;
  border: 1px solid rgba(216, 179, 106, 0.32);
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.contact-links a:hover,
.contact-links a:focus-visible {
  background: rgba(216, 179, 106, 0.06);
  border-color: rgba(216, 179, 106, 0.5);
  color: var(--text);
}

.contact-form {
  display: grid;
  gap: 1rem;
  width: min(100%, 42rem);
  justify-self: center;
}

.contact-field {
  display: grid;
  gap: 0.5rem;
}

.contact-field span {
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.contact-field input,
.contact-field textarea {
  width: 100%;
  border: 1px solid var(--panel-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 0.95rem 1rem;
  font: inherit;
  resize: vertical;
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: 1px solid rgba(216, 179, 106, 0.45);
  border-color: rgba(216, 179, 106, 0.45);
}

.contact-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.contact-button,
.email-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 14rem;
  min-height: 3.5rem;
  padding: 0.9rem 1.3rem;
  border: 1px solid rgba(216, 179, 106, 0.35);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-button:disabled {
  opacity: 0.55;
  cursor: wait;
}

.contact-status {
  min-height: 1.2rem;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.not-found-section {
  min-height: calc(100vh - 5.5rem);
  justify-items: center;
  align-content: center;
  gap: 2rem;
}

.not-found-copy {
  display: grid;
  gap: 0.5rem;
  text-align: center;
}

.not-found-code,
.not-found-text {
  margin: 0;
}

.not-found-code {
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.not-found-text {
  color: var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
}

.not-found-links {
  margin-bottom: 0;
}

.media-dialog {
  width: min(94vw, 1280px);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  box-shadow: none;
}

.media-dialog::backdrop {
  background: rgba(3, 3, 3, 0.24);
  backdrop-filter: blur(10px) saturate(0.9);
}

.dialog-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  border: 0;
  background: transparent;
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.dialog-content {
  aspect-ratio: var(--dialog-aspect-ratio, 16 / 9);
  background: transparent;
  width: min(94vw, 1280px);
  max-height: 88vh;
}

.dialog-content video,
.dialog-content img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  max-height: 88vh;
}

.dialog-photo-frame {
  position: relative;
  width: fit-content;
  max-width: min(92vw, 1280px);
  height: fit-content;
  max-height: 88vh;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 1.2rem;
}

.dialog-photo-backdrop {
  display: none;
}

.dialog-photo-image {
  position: relative;
  z-index: 1;
  width: auto;
  max-width: min(92vw, 1280px);
  height: auto;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 1.2rem;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.22);
  background: transparent;
}

.dialog-arrow {
  background: rgba(255, 255, 255, 0.08);
  z-index: 2;
  backdrop-filter: blur(10px);
  border-color: rgba(255, 255, 255, 0.12);
}

.media-dialog[data-mode="photo"] {
  width: auto;
  max-width: 96vw;
}

.media-dialog[data-mode="photo"] .dialog-content {
  aspect-ratio: auto;
}

.media-dialog[data-mode="photo"] .dialog-close {
  top: 1.2rem;
  right: 1.2rem;
}

.media-dialog[data-mode="photo"] .dialog-arrow.is-prev {
  left: 1.2rem;
}

.media-dialog[data-mode="photo"] .dialog-arrow.is-next {
  right: 1.2rem;
}

.media-dialog[data-mode="video"][data-video-format="portrait"] {
  width: auto;
  max-width: min(92vw, 34rem);
}

.media-dialog[data-mode="video"][data-video-format="portrait"] .dialog-content {
  width: min(92vw, 34rem);
  max-height: 88vh;
}

.media-dialog[data-mode="video"][data-video-format="portrait"] .dialog-content video {
  max-height: 88vh;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media (max-width: 900px) {
  .topbar {
    padding: 1rem;
  }

  .hero {
    min-height: 100svh;
  }

  .content-section {
    width: min(calc(100% - 1.25rem), var(--max-width));
    padding: 2rem 0 3rem;
  }

  .project-card {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
  }

  body[data-page="commercial"] .project-card.is-triptych {
    grid-column: span 6;
    aspect-ratio: var(--project-aspect-ratio, 9 / 16);
    max-height: none;
  }

  .project-meta {
    align-items: flex-end;
    padding: 0.95rem 1rem;
  }

  .project-copy h3 {
    font-size: 1rem;
  }

  .project-copy p,
  .project-format {
    font-size: 0.8rem;
  }

  .project-logo {
    inset: 50% auto auto 50%;
  }

  .photo-grid {
    columns: 2 160px;
  }

  .narrative-layout {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 620px) {
  .topbar {
    justify-content: flex-start;
  }

  .nav {
    justify-content: flex-end;
    gap: 0.75rem;
  }

  .project-card {
    aspect-ratio: 16 / 9;
  }

  body[data-page="commercial"] .project-card:not(.is-triptych) {
    grid-column: 1 / -1;
  }

  body[data-page="commercial"] .project-card.is-triptych {
    grid-column: span 6;
  }

  .project-meta {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    inset: auto 0 0 0;
    padding: 0.8rem 0.9rem;
  }

  .project-copy {
    max-width: calc(100% - 4rem);
  }

  .project-copy h3 {
    font-size: 0.96rem;
    line-height: 1;
  }

  .project-copy p {
    margin-top: 0.2rem;
    font-size: 0.74rem;
    line-height: 1.1;
  }

  .project-format {
    margin-top: 0;
    font-size: 0.74rem;
    line-height: 1;
    white-space: nowrap;
  }

  .photo-grid {
    columns: 1 100%;
  }
}
