:root {
  --bg-body: #f6f6f6;
  --bg-header: #ffffff;
  --text-main: #111111;
  --overlay: rgba(0, 0, 0, 0.35);
  --overlay-hover: rgba(0, 0, 0, 0.55);
  --focus-outline: #111111;
  --plum: #362b32;
  --header-border: #e0e0e0;
  /* Contact button light mode palette (grey top on grey page) */
  --contact-btn-border: rgba(0, 0, 0, 0.12);
  --contact-btn-text: #111111;
  --contact-btn-bg: #f6f6f6;
  --contact-btn-bg-hover: #e9e9e9;
  --contact-btn-shadow-fill: #f6f6f6;
  --contact-btn-shadow-border: rgba(0, 0, 0, 0.06);
  --contact-btn-shadow-base: rgba(0, 0, 0, 0.18);
}

body[data-theme="dark"] {
  --bg-body: #362b32;
  --bg-header: #362b32;
  --text-main: #f5f5f5;
  --overlay: rgba(0, 0, 0, 0.5);
  --overlay-hover: rgba(0, 0, 0, 0.7);
  --focus-outline: #f5f5f5;
  --header-border: rgba(255, 255, 255, 0.06);
  /* Contact button dark mode palette (light plum-grey top so it's not pure white) */
  --contact-btn-border: rgba(255, 255, 255, 0.75);
  --contact-btn-text: #111111;
  --contact-btn-bg: #f0e8f5;
  --contact-btn-bg-hover: #e3d7f0;
  --contact-btn-shadow-fill: #f0e8f5;
  --contact-btn-shadow-border: rgba(0, 0, 0, 0.6);
  --contact-btn-shadow-base: rgba(0, 0, 0, 0.85);
}

/* Base reset and typography */

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

html {
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background-color: var(--bg-body);
  color: var(--text-main);
}

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

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

button {
  font: inherit;
}

/* Accessibility helpers */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

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

/* Layout containers */

.site-header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.content-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

.page-placeholder {
  min-height: 60vh;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 1.5rem;
  letter-spacing: 0.05em;
  color: #222222;
}

/* Stills sections */

.stills-section {
  margin-bottom: 40px;
}

.section-heading {
  margin: 0 0 16px;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-main);
}

.contact-section .section-heading {
  color: var(--text-main);
}

.profile-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  align-items: center;
  margin-bottom: 48px;
}

.profile-layout__image {
  position: relative;
  padding-bottom: 12px;
  margin-bottom: 8px;
}

.profile-layout__image::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 70%;
  height: 1px;
  background-color: rgba(0, 0, 0, 0.18);
}

body[data-theme="dark"] .profile-layout__image::after {
  background-color: rgba(255, 255, 255, 0.4);
}

.profile-layout__image img {
  max-width: 320px;
  width: 100%;
  border-radius: 8px;
  display: block;
}

.profile-layout__text {
  flex: 1;
  min-width: 260px;
}

.profile-heading-main {
  color: var(--text-main);
}

.profile-heading-sub {
  font-size: 0.75rem;
  margin-top: 4px;
  letter-spacing: 0.18em;
  color: rgba(0, 0, 0, 0.65);
}

body[data-theme="dark"] .profile-heading-sub {
  color: #f0e8f5;
}

/* Contact links and form */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.contact-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 6px;
  background-color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.contact-link:hover,
.contact-link:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.contact-link__icon {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}

.contact-link__icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.contact-link__label {
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #333333;
}

body[data-theme="dark"] .contact-link__label {
  color: var(--plum);
}

/* Theme toggle */

.theme-toggle {
  position: relative;
  width: 56px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  cursor: pointer;
  color: #111111;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

body[data-theme="dark"] .theme-toggle {
  background: rgba(10, 10, 12, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  color: #f5f5f5;
}

.theme-toggle__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 180ms ease, background 180ms ease;
}

body[data-theme="dark"] .theme-toggle__thumb {
  background: var(--plum);
}

.theme-toggle__icon {
  font-size: 0.75rem;
  line-height: 1;
  position: relative;
  z-index: 1;
  opacity: 0.55;
  transition: opacity 180ms ease;
}

.theme-toggle__icon--sun {
  margin-right: 2px;
}

.theme-toggle__icon--moon {
  margin-left: 2px;
}

.theme-toggle--dark .theme-toggle__thumb {
  transform: translateX(24px);
}

.theme-toggle--dark .theme-toggle__icon--moon,
.theme-toggle:not(.theme-toggle--dark) .theme-toggle__icon--sun {
  opacity: 1;
}

.contact-form {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-form-row label {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-main);
}

.contact-form-row input,
.contact-form-row textarea {
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px solid #cccccc;
  font: inherit;
}

.contact-form-row textarea {
  min-height: 120px;
  resize: vertical;
}

.contact-form button[type="submit"] {
  position: relative;
  align-self: flex-start;
  display: inline-block;
  padding: 0.9em 1.8em;
  border-radius: 1em;
  border: 2px solid #ffffff;
  background: #ffffff;
  color: #111111; /* Adjust text color for contrast */
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: all 175ms cubic-bezier(0, 0, 1, 1);
}

.contact-form button[type="submit"]::before {
  position: absolute;
  content: "";
  inset: 0;
  background: var(--contact-btn-shadow-fill);
  border-radius: inherit;
  box-shadow:
    0 0 0 2px var(--contact-btn-shadow-border),
    0 0.75em 0 0 var(--contact-btn-shadow-base);
  transform: translate3d(0, 0.75em, -1em);
  transition: all 175ms cubic-bezier(0, 0, 1, 1);
  z-index: -1;
}

.contact-form button[type="submit"]:hover {
  background: var(--contact-btn-bg-hover);
  transform: translate(0, 0.375em);
}

.contact-form button[type="submit"]:hover::before {
  transform: translate3d(0, 0.5em, -1em);
}

.contact-form button[type="submit"]:active {
  transform: translate(0, 0.75em);
}

.contact-form button[type="submit"]:active::before {
  transform: translate3d(0, 0, -1em);
  box-shadow:
    0 0 0 2px var(--contact-btn-shadow-border),
    0 0.25em 0 0 var(--contact-btn-shadow-base);
}

/* Lightbox */

.masonry-gallery img {
  cursor: zoom-in;
}

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
  z-index: 999;
}

.lightbox-backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-image {
  max-width: min(92vw, 1200px);
  max-height: 92vh;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
  border-radius: 6px;
  transform: scale(0.96);
  transition: transform 220ms ease;
  cursor: zoom-out;
}

.lightbox-backdrop.is-visible .lightbox-image {
  transform: scale(1);
}

/* Films page */

.film-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.film-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.film-card--short {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.film-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #050507;
  border: none;
}

.film-video--short {
  aspect-ratio: 9 / 16;
}

.film-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.film-title {
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.film-desc {
  color: #555555;
  font-size: 0.95rem;
}

body[data-theme="dark"] .film-desc {
  color: #ddd5e4;
}

/* Featured gallery */

.featured-header,
.films-header {
  margin-bottom: 24px;
}

.featured-heading,
.films-heading {
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-main);
}

.featured-subtitle,
.films-subtitle {
  margin: 6px 0 14px;
  font-size: 0.9rem;
  color: #555555;
}

body[data-theme="dark"] .featured-subtitle,
body[data-theme="dark"] .films-subtitle {
  color: #ddd5e4;
}

.featured-cta-link {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: transparent;
  color: #111111;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease,
    border-color 160ms ease;
}

.featured-cta-link:hover,
.featured-cta-link:focus-visible {
  background: rgba(0, 0, 0, 0.04);
}

body[data-theme="dark"] .featured-cta-link {
  border-color: rgba(255, 255, 255, 0.4);
  color: #f5f5f5;
}

body[data-theme="dark"] .featured-cta-link:hover,
body[data-theme="dark"] .featured-cta-link:focus-visible {
  background: rgba(255, 255, 255, 0.06);
}

.masonry-gallery {
  column-count: 3;
  column-gap: 16px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 16px;
}

.masonry-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
}

@media (max-width: 900px) {
  .masonry-gallery {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .masonry-gallery {
    column-count: 1;
  }
}

/* Header: logo and navigation */

.logo-link {
  display: inline-flex;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #111111;
}

.main-nav {
  flex: 1;
}

.nav-list {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 24px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item a {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #333333;
}

.nav-item a:hover {
  color: #000000;
}

body[data-theme="dark"] .logo-link,
body[data-theme="dark"] .nav-item a {
  color: #ffffff;
}

body[data-theme="dark"] .nav-item a:hover {
  color: #f5f5f5;
}

.nav-search-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  color: #333333;
  padding: 4px;
}

.nav-search-btn:hover {
  color: #000000;
}

/* Hero grid and tiles */

.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.hero-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 6px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 1rem;
  background-color: var(--plum);
  transform: translateZ(0);
  transition:
    transform 200ms ease,
    box-shadow 200ms ease;
}

.hero-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--overlay);
  transition: background 200ms ease;
}

.hero-tile__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}

/* Fine-tune focal points for key crops */
.hero-tile--featured .hero-tile__image {
  object-position: center 35%;
}

.hero-tile--films .hero-tile__image {
  object-position: 50% 45%;
}

.hero-tile--stills .hero-tile__image {
  object-position: center;
}

.hero-tile__label {
  position: relative;
  z-index: 1;
  text-align: center;
  font-weight: 500;
  display: inline-block;
  transition:
    transform 160ms ease,
    font-weight 160ms ease;
}

.hero-tile--stills {
  grid-column: 1 / -1;
}

.hero-tile:hover,
.hero-tile:focus-visible {
  transform: scale(1.02);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.hero-tile:hover::before,
.hero-tile:focus-visible::before {
  background: var(--overlay-hover);
}

.hero-tile:hover .hero-tile__label,
.hero-tile:focus-visible .hero-tile__label {
  font-weight: 700;
  transform: scale(1.12);
}

/* Ensure focus ring is visible on hero tiles */
.hero-tile:focus-visible {
  outline: 2px solid var(--focus-outline);
  outline-offset: 4px;
}

/* Responsive adjustments */

@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-list {
    justify-content: flex-start;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .content-wrapper {
    padding-top: 24px;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .hero-tile--stills {
    grid-column: auto;
  }
}
