/*
Theme Name: Sebastian Cinematographer
Theme URI: https://github.com/sebastian
Author: Manuel
Description: Minimalist cinematographer portfolio — video-first, black/white aesthetic
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: sebastian
*/

/* ============================================================
   CSS VARIABLES
   ============================================================ */
:root {
  --black: #0a0a0a;
  --white: #f5f5f0;
  --gray-dark: #1a1a1a;
  --gray-mid: #333333;
  --gray-light: #aaaaaa;
  --accent: #f5f5f0;
  --font-display: 'lorimer-no-2', Georgia, serif;
  --font-body: 'lorimer-no-2', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono: 'Courier New', monospace;
  --nav-height: 5rem;
  --nav-z: 1000;
  --overlay-z: 999;
  --transition: 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-fast: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.6;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body > *:not(#site-footer):not(.page-transition):not(#nav-overlay):not(#video-lightbox):not(#site-nav):not(script):not(link):not(style) {
  flex-shrink: 0;
}

a, a:hover, a:focus, a:active,
.wp-element-button,
.wp-block-button__link,
.entry-content a {
  color: inherit;
  text-decoration: none;
}

/* Visible keyboard focus (only for keyboard nav, not mouse clicks) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Skip-to-content link — visible only when focused */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 1000;
  background: var(--white);
  color: var(--black);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  border-radius: 3px;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .marquee-track {
    animation: none !important;
  }
}

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

ul, ol {
  list-style: none;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */
.display {
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-light);
}

/* ============================================================
   NAV — FIXED TOP BAR
   ============================================================ */
#site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: var(--nav-z);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem;
  mix-blend-mode: normal;
}

.nav-logo {
  font-family: var(--font-body);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--white);
  z-index: calc(var(--nav-z) + 1);
  position: relative;
  transition: opacity var(--transition-fast);
}

.nav-logo:hover {
  opacity: 0.5;
}

/* Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 16px;
  cursor: pointer;
  z-index: calc(var(--nav-z) + 1);
  position: relative;
  background: none;
  border: none;
  padding: 0;
}

.nav-toggle span {
  display: block;
  width: 100%;
  height: 1px;
  background-color: var(--white);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  transform-origin: center;
}

/* Open state */
.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ============================================================
   FULLSCREEN OVERLAY MENU
   ============================================================ */
#nav-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--overlay-z);
  background-color: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

#nav-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

.overlay-menu {
  text-align: center;
}

.overlay-menu li {
  overflow: hidden;
  margin-bottom: 0.25rem;
  padding: 0.1em 0.5em;
}

.overlay-menu a {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 7rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.1;
  color: var(--white);
  display: inline-block;
  transform: translateY(110%);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), color var(--transition-fast);
  transition-delay: 0s;
}

.overlay-menu a:hover {
  color: var(--gray-light);
}

#nav-overlay.is-open .overlay-menu a {
  transform: translateY(0);
}

#nav-overlay.is-open .overlay-menu li:nth-child(1) a { transition-delay: 0.1s; }
#nav-overlay.is-open .overlay-menu li:nth-child(2) a { transition-delay: 0.15s; }
#nav-overlay.is-open .overlay-menu li:nth-child(3) a { transition-delay: 0.2s; }
#nav-overlay.is-open .overlay-menu li:nth-child(4) a { transition-delay: 0.25s; }
#nav-overlay.is-open .overlay-menu li:nth-child(5) a { transition-delay: 0.3s; }

.overlay-footer {
  position: absolute;
  bottom: 2.5rem;
  left: 2.5rem;
  right: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.overlay-footer .label {
  font-size: 0.6rem;
}

/* ============================================================
   HERO — HOMEPAGE
   ============================================================ */
#hero {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 2.5rem;
  overflow: hidden;
}

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 50%,
    rgba(10,10,10,0.7) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 5.5rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 60%;
}

.hero-meta {
  text-align: right;
}

.hero-scroll {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  opacity: 0.5;
}

.hero-scroll-line {
  width: 40px;
  height: 1px;
  background: var(--white);
  animation: scrollLine 2s ease-in-out infinite;
}

@keyframes scrollLine {
  0%, 100% { transform: scaleX(1); opacity: 1; }
  50% { transform: scaleX(0.3); opacity: 0.3; }
}

/* Hero iframe (Vimeo / YouTube background) */
.hero-video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
  opacity: 0.7;
}

.hero-video-iframe iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 177.78vh; /* 16:9 coverage */
  height: 100vh;
  min-width: 100%;
  min-height: 100%;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}

/* ============================================================
   PORTFOLIO GRID
   ============================================================ */
#portfolio {
  padding: 3rem 2.5rem 4rem;
}

.portfolio-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-mid);
}

.portfolio-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 300;
  font-style: italic;
}

.portfolio-count {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-light);
}

/* Grid — Isotope masonry container */
.projects-grid {
  position: relative;
}

/* Isotope column unit = 1/12 of the row (so the width classes below — which are
   multiples of 1/12 — tile correctly). One column = (100% - 11 gutters) / 12. */
.grid-sizer {
  width: calc(8.3333% - 18.333px);
}

.gutter-sizer {
  width: 20px;
}

/* Item widths */
.project-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  background: transparent;
  width: calc(50% - 10px);
  margin-bottom: 20px;
}

/* Width classes */
.project-item--third {
  width: calc(33.333% - 14px);
}

.project-item--narrow {
  width: calc(41.667% - 10px);
}

.project-item--wide {
  width: calc(58.333% - 10px);
}

.project-item--twothird {
  width: calc(66.667% - 10px);
}

.project-item--full {
  width: 100%;
}

/* Aspect ratios — default to 16:9 to match video */
.project-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.project-thumb--16\:9  { aspect-ratio: 16/9; }
.project-thumb--4\:3   { aspect-ratio: 4/3; }
.project-thumb--3\:2   { aspect-ratio: 3/2; }
.project-thumb--1\:1   { aspect-ratio: 1/1; }
.project-thumb--21\:9  { aspect-ratio: 21/9; }
.project-thumb--9\:16  { aspect-ratio: 9/16; }

.project-thumb > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--thumb-pos, center);
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              filter 0.6s ease;
  filter: grayscale(20%);
}

/* Fallback thumbnail (first frame of hover preview) when no featured image */
video.project-thumb-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--thumb-pos, center);
  display: block;
  filter: grayscale(20%);
}

/* Hover effects */
.project-item--hover-zoom:hover .project-thumb > img {
  transform: scale(1.04);
  filter: grayscale(0%);
}

.project-item--hover-fade:hover .project-thumb > img {
  filter: grayscale(0%);
  opacity: 0.8;
}

.project-item--hover-none .project-thumb > img {
  filter: none;
}

/* Hover video preview */
.project-hover-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--thumb-pos, center);
  opacity: 0;
  /* Smooth fade of the whole layer (black backdrop + video) in and out */
  transition: opacity 0.45s ease;
  z-index: 1;
  /* A touch of black behind the video while it loads — fades in/out
     with the layer, so no hard flash and no feature image bleed-through */
  background-color: var(--black);
}

.project-item:hover .project-hover-video {
  opacity: 1;
}

/* Hover overlay */
.project-hover-overlay {
  display: none;
}

.project-hover-meta {
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  user-select: text;
  -webkit-user-select: text;
}

.project-hover-meta .project-title,
.project-hover-meta .project-category,
.project-hover-meta .project-year,
.project-hover-meta .project-hover-sep {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: #fff;
  cursor: text;
}

/* Mobile thumbnail — hidden on desktop */
.project-thumb-mobile {
  display: none;
}

/* Meta below thumbnail — always visible */
.project-mobile-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.6rem 0;
}

.project-mobile-meta .project-title,
.project-mobile-meta .project-category,
.project-mobile-meta .project-year,
.project-mobile-meta .project-hover-sep {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: var(--white);
}

@media (max-width: 768px) {
  .project-hover-overlay {
    display: none;
  }

  /* No hover effect on mobile/touch — neutralise zoom/fade so a tap
     doesn't leave the thumbnail stuck in a hovered state */
  .project-item .project-thumb > img {
    transform: none !important;
    opacity: 1 !important;
    filter: grayscale(20%) !important;
  }
  .project-hover-video {
    display: none !important;
  }

  /* Swap to mobile thumbnail if available */
  .has-mobile-thumb .project-thumb > img:not(.project-thumb-mobile) {
    display: none;
  }

  .has-mobile-thumb .project-thumb-mobile {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 9/16;
  }

  .has-mobile-thumb .project-thumb {
    aspect-ratio: auto;
  }

  .project-item {
    background: transparent;
  }

}

/* Self-hosted hover video (.mp4) */
video.project-hover-video--mp4 {
  object-fit: cover;
}

/* Vimeo background mode already crops to cover → fill the card exactly */
.project-hover-video[data-vimeo-id] iframe {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: 0 !important;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* YouTube has no cover mode → oversize the iframe so the built-in
   letterbox bars are cropped outside the card */
.project-hover-video[data-youtube-id] iframe {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  width: 160% !important;
  height: 160% !important;
  border: 0 !important;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

/* ============================================================
   SINGLE PROJECT PAGE
   ============================================================ */

/* Video embed hero */
.project-video-hero {
  padding-top: var(--nav-height);
  background: var(--black);
  contain: layout style;
}

/* Desktop/mobile hero toggle */
.project-hero--mobile { display: none; }

@media (max-width: 768px) {
  .project-hero--desktop { display: none !important; }
  .project-hero--mobile  { display: block !important; }

  /* When no separate mobile hero exists, both classes are absent — desktop video shows at 16:9 */
  .project-video-hero:not(.project-hero--desktop):not(.project-hero--mobile) .project-video-embed {
    aspect-ratio: 16/9;
    max-height: none;
  }

  /* Mobile-specific hero: fill the screen */
  .project-hero--mobile .project-video-embed {
    aspect-ratio: auto;
    height: calc(100vh - var(--nav-height));
    max-height: none;
  }

  .project-hero--mobile img {
    aspect-ratio: auto;
    height: calc(100vh - var(--nav-height));
    max-height: none;
  }
}

.project-video-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: calc(100vh - var(--nav-height));
  overflow: hidden;
  background: var(--black);
}

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

/* Fallback hero image */
.project-hero {
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
  background: var(--black);
}

.project-hero img {
  width: 100%;
  aspect-ratio: 16/9;
  max-height: calc(100vh - var(--nav-height));
  object-fit: cover;
}

.project-body {
  max-width: 1536px;
  margin: 0 auto;
  padding: 2rem 2.5rem;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  margin-bottom: 1rem;
}

.project-header-main {
  min-width: 0;
}

/* External link buttons (IMDb / YouTube) at the right end of the header row */
.project-links {
  display: flex;
  gap: 0.75rem;
  flex-shrink: 0;
}

.project-link-btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--black);
  border: 1px solid var(--white);
  padding: 0.75rem 1.5rem;
  white-space: nowrap;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.project-link-btn:hover {
  background: var(--white);
  color: var(--black);
}

.project-page-title {
  font-family: var(--font-body);
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--white);
  margin-bottom: 1rem;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.project-meta-row {
  display: flex;
  gap: 1.5rem;
  padding-bottom: 1.5rem;
}

.meta-value {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--white);
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.project-description,
.project-description p {
  font-size: 0.875rem;
  line-height: 1.8;
  color: var(--white) !important;
  margin-bottom: 1rem;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

/* Credits: Cast / Crew / Awards & Press (multi-line) — always stacked */
.project-credits {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-bottom: 1.5rem;
}

/* Credits + Stills layout.
   Default: stacked (credits, then gallery below — used when 0–1 credit blocks).
   --split: 2+ credit blocks AND a gallery → gallery sits beside the credits. */
.project-info-layout--split {
  display: grid;
  grid-template-columns: minmax(220px, 300px) 1fr;
  gap: 3rem;
  align-items: start;
}

.project-info-layout--split .project-credits {
  padding-bottom: 0;
}

.project-info-layout--split .project-stills {
  margin-top: 0;
}

/* Links inside credit lines */
.project-credit-text a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  text-decoration-color: var(--gray-mid);
  transition: text-decoration-color var(--transition-fast);
}

.project-credit-text a:hover {
  text-decoration-color: var(--white);
}

.project-credit-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gray-light);
  margin-bottom: 0.4rem;
}

.project-credit-text {
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--white);
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

.project-credit-line {
  display: block;
  break-inside: avoid;
}

/* Long lists: flow into up to two columns side by side */
.project-credit-text--cols {
  columns: 2 11rem;
  column-gap: 2.5rem;
}

/* Download button */
.project-download {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--white);
  border: 1px solid var(--gray-mid);
  padding: 0.75rem 1.5rem;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  margin-bottom: 4rem;
}

.project-download:hover {
  border-color: var(--white);
  background: rgba(245, 245, 240, 0.05);
}

/* Stills & BTS section */
.project-stills {
  margin-top: 2rem;
  content-visibility: auto;
  contain-intrinsic-size: auto 500px;
}

.project-section-title,
.similar-projects-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 300;
  font-style: italic;
  margin-bottom: 2rem;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
}

/* Stills & BTS gallery — CSS grid driven by custom properties */
.project-content {
  --gallery-gap: 20px;
  display: grid;
  gap: var(--gallery-gap);
}

/* Column variants */
.project-content--cols-1 { grid-template-columns: 1fr; }
.project-content--cols-2 { grid-template-columns: repeat(2, 1fr); }
.project-content--cols-3 { grid-template-columns: repeat(3, 1fr); }
.project-content--cols-4 { grid-template-columns: repeat(4, 1fr); }

/* All images in the gallery */
.project-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

/* Force aspect ratio when set */
.project-content[style*="--gallery-ratio"] .wp-block-image,
.project-content[style*="--gallery-ratio"] .wp-block-gallery .wp-block-image {
  aspect-ratio: var(--gallery-ratio);
  overflow: hidden;
}

/* Gallery block — flatten into the grid */
.project-content .wp-block-gallery {
  display: contents;
}

.project-content .wp-block-gallery .wp-block-image {
  margin: 0;
}

/* Columns block — flatten into the grid */
.project-content .wp-block-columns {
  display: contents;
}

.project-content .wp-block-column {
  overflow: hidden;
}

/* Image block */
.project-content .wp-block-image {
  margin: 0;
  overflow: hidden;
}

.project-content .wp-block-image figcaption {
  font-size: 0.7rem;
  color: var(--gray-light);
  margin-top: 0.5rem;
}

/* Video block */
.project-content .wp-block-video {
  grid-column: 1 / -1;
}

.project-content .wp-block-video video {
  width: 100%;
}

/* Spacer block */
.project-content .wp-block-spacer {
  display: none;
}

/* Paragraph/text — span full width */
.project-content p {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--gray-light);
  margin: 0;
}

/* Headings — span full width */
.project-content h2,
.project-content h3 {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-weight: 300;
  font-style: italic;
  margin: 1rem 0 0;
}

/* Make individual images span full width when desired */
.project-content .wp-block-image.size-full,
.project-content .wp-block-image.alignfull {
  grid-column: 1 / -1;
}

@media (max-width: 768px) {
  .project-content--cols-2,
  .project-content--cols-3,
  .project-content--cols-4 {
    grid-template-columns: 1fr;
  }

  /* Credits + gallery always stack on mobile */
  .project-info-layout--split {
    display: block;
  }

  .project-info-layout--split .project-credits {
    padding-bottom: 1.5rem;
  }

  .project-info-layout--split .project-stills {
    margin-top: 2rem;
  }
}

.project-gallery {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gallery-row {
  display: flex;
  gap: 2px;
}

.gallery-item {
  flex: 1;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-item:hover img {
  transform: scale(1.02);
}

/* Similar Projects */
.similar-projects {
  padding: 4rem 2.5rem;
  border-top: 1px solid var(--gray-mid);
  content-visibility: auto;
  contain-intrinsic-size: auto 400px;
}

.similar-projects-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 300;
  font-style: normal;
  margin-bottom: 2.5rem;
}

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

.similar-project-item {
  display: block;
  overflow: hidden;
}

.similar-project-thumb {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.similar-project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(20%);
  transition: transform 0.6s ease, filter 0.4s ease;
}

.similar-project-item:hover .similar-project-thumb img {
  transform: scale(1.04);
  filter: grayscale(0%);
}

/* Hover video preview (same behaviour as the grid card) */
.similar-project-item:hover .project-hover-video {
  opacity: 1;
}

.similar-project-meta {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.6rem 0;
}

.similar-project-meta .project-title,
.similar-project-meta .project-category,
.similar-project-meta .project-year,
.similar-project-meta .project-hover-sep {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  font-style: normal;
  letter-spacing: 0.08em;
  line-height: 1.2;
  color: var(--white);
}

/* Project Navigation */
.project-nav {
  display: flex;
  border-top: 1px solid var(--gray-mid);
  border-bottom: 1px solid var(--gray-mid);
}

.project-nav-link {
  flex: 1;
  padding: 2rem 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: background var(--transition-fast);
}

.project-nav-link:hover {
  background: var(--gray-dark);
}

.project-nav-prev {
  border-right: 1px solid var(--gray-mid);
}

.project-nav-next {
  align-items: flex-end;
}

.project-nav-link .label {
  color: var(--white);
}

.project-nav-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--white);
}

/* ============================================================
   IMAGE LIGHTBOX
   ============================================================ */
#image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10, 10, 10, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#image-lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.image-lightbox-close {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  z-index: 2001;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
  font-family: var(--font-body);
}

.image-lightbox-close:hover { opacity: 1; }

.image-lightbox-img {
  max-width: 92vw;
  max-height: 90vh;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.image-lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2001;
  background: none;
  border: none;
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity var(--transition-fast);
  padding: 1rem;
  font-family: var(--font-body);
}

.image-lightbox-nav:hover { opacity: 1; }
.image-lightbox-prev { left: 1rem; }
.image-lightbox-next { right: 1rem; }

.image-lightbox-counter {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(245, 245, 240, 0.5);
}

/* Project content images */
.project-content img {
  cursor: default;
}

/* ============================================================
   VIDEO LIGHTBOX
   ============================================================ */
#video-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(10,10,10,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

#video-lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-inner {
  width: 90vw;
  max-width: 1536px;
  position: relative;
}

.lightbox-inner video {
  width: 100%;
  aspect-ratio: 16/9;
}

.lightbox-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: none;
  border: none;
  color: var(--white);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.lightbox-close:hover { opacity: 1; }

.lightbox-close::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--white);
}

/* ============================================================
   PAGE & ARCHIVE MAIN
   ============================================================ */
.page-main {
  padding-top: calc(var(--nav-height) + 3rem);
  min-height: 60vh;
}

.archive-main {
  padding-top: calc(var(--nav-height) + 2rem);
}

/* Homepage: when #portfolio is the first section (no hero), clear the nav */
.home-main > #portfolio:first-child {
  padding-top: calc(var(--nav-height) + 3rem);
}

/* ============================================================
   DEFAULT PAGE CONTENT
   ============================================================ */
.page-default-content {
  max-width: 1536px;
  margin: 0 auto;
  padding: 2rem 2.5rem 6rem;
}

/* ============================================================
   ABOUT / INFO SECTION
   ============================================================ */
#about {
  padding: 4rem 2.5rem;
  max-width: 1536px;
  margin: 0 auto;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.about-left {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.about-statement {
  font-family: var(--font-body);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 400;
  font-style: normal;
  line-height: 1.35;
  letter-spacing: 0;
  margin-bottom: 1.5rem;
}

.about-right img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.about-details p {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--white);
  margin-bottom: 1.5rem;
}

.about-details a {
  border-bottom: 1px solid var(--gray-mid);
  transition: border-color var(--transition-fast);
}

.about-details a:hover {
  border-color: var(--white);
}

/* Rental page: text aligned to top, smaller image */
.about--rental .about-grid {
  align-items: start;
}

.about--rental .about-right img {
  max-width: 47%;
  margin-left: auto;
}

/* ============================================================
   FOOTER
   ============================================================ */
#site-footer {
  padding: 2rem 2.5rem;
  border-top: 1px solid var(--gray-mid);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}

.footer-left .label { margin-bottom: 0; color: var(--white); }

.footer-social {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.footer-social a {
  color: var(--white);
  transition: color var(--transition-fast);
  display: flex;
}

.footer-social a:hover { color: var(--white); }

.footer-right {
  text-align: right;
  display: flex;
  gap: 1.5rem;
}

.footer-link {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  transition: color var(--transition-fast);
}

.footer-link:hover { color: var(--white); }

/* ============================================================
   LEGAL POPUPS (Imprint, Privacy, AGB)
   ============================================================ */
.legal-popup {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(10, 10, 10, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(8px);
}

.legal-popup.is-open {
  opacity: 1;
  pointer-events: all;
}

.legal-popup-inner {
  width: 90vw;
  max-width: 700px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  padding: 3rem;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-mid) transparent;
}

.legal-popup-inner::-webkit-scrollbar { width: 4px; }
.legal-popup-inner::-webkit-scrollbar-track { background: transparent; }
.legal-popup-inner::-webkit-scrollbar-thumb { background: var(--gray-mid); border-radius: 2px; }

.legal-popup-close {
  position: fixed;
  top: 1.5rem;
  right: 2rem;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
  z-index: 3001;
}

.legal-popup-close:hover { opacity: 1; }

.legal-popup-content {
  color: var(--white);
}

.legal-popup-content h2 {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--white);
  margin-bottom: 1.2rem;
}

.legal-popup-content h3 {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  margin: 1.5rem 0 0.6rem;
}

.legal-popup-content p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--white);
  margin-bottom: 0.8rem;
}

.legal-popup-content strong {
  color: var(--white);
  font-weight: 400;
}

.legal-popup-content ul {
  list-style: none;
  padding: 0;
  margin-bottom: 0.8rem;
}

.legal-popup-content li {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--white);
  padding-left: 1rem;
  position: relative;
}

.legal-popup-content li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--gray-mid);
}

.legal-popup-content a {
  color: var(--white);
  border-bottom: 1px solid var(--gray-mid);
  transition: border-color var(--transition-fast);
}

.legal-popup-content a:hover {
  border-color: var(--white);
}

.legal-popup-download {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-mid);
}

.legal-download-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  text-decoration: none;
  border-bottom: none;
  transition: color var(--transition-fast);
}

.legal-download-link:hover {
  border-color: var(--white);
}

/* ============================================================
   FRONTEND FILE UPLOAD
   ============================================================ */
.seb-upload-form {
  width: 100%;
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
}

.seb-upload-form .project-download {
  display: flex;
  width: 100%;
  justify-content: center;
  margin-bottom: 1rem;
}

.seb-upload-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 2.5rem 2rem;
  border: 1px dashed var(--gray-mid);
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  text-align: center;
}

.seb-upload-dropzone:hover,
.seb-upload-dropzone.is-dragover {
  border-color: var(--white);
  background: rgba(245, 245, 240, 0.03);
}

.seb-upload-input {
  display: none;
}

.seb-upload-icon {
  color: var(--gray-light);
}

.seb-upload-text {
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
}

.seb-upload-hint {
  font-size: 0.65rem;
  color: var(--gray-light);
}

.seb-upload-filename {
  font-size: 0.7rem;
  color: var(--white);
  margin-top: 0.3rem;
}

.seb-upload-notes {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  background: none;
  border: 1px solid var(--gray-mid);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.5;
  resize: vertical;
  transition: border-color var(--transition-fast);
}

.seb-upload-notes:focus {
  outline: none;
  border-color: var(--white);
}

.seb-upload-notes::placeholder {
  color: var(--gray-light);
}

.seb-upload-submit {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  background: none;
  border: 1px solid var(--gray-mid);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.seb-upload-submit:hover:not(:disabled) {
  border-color: var(--white);
  background: rgba(245, 245, 240, 0.05);
}

.seb-upload-submit:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.seb-upload-message {
  width: 100%;
  padding: 1rem;
  font-size: 0.8rem;
  text-align: center;
}

.seb-upload-message.is-success {
  color: var(--white);
}

.seb-upload-message.is-error {
  color: #e55;
}

button.footer-link {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

/* ============================================================
   PAGE TRANSITIONS
   ============================================================ */
.page-transition {
  position: fixed;
  inset: 0;
  background: var(--black);
  z-index: 9000;
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.76, 0, 0.24, 1), opacity 0.25s ease;
}

.page-transition.entering {
  transform: translateY(0);
  opacity: 1;
}

.page-transition.leaving {
  transform: translateY(-100%);
  opacity: 0;
}

/* ============================================================
   PAGE LOADER
   ============================================================ */
#page-loader {
  position: fixed;
  inset: 0;
  z-index: 8000;
  background: var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

#page-loader.is-done {
  opacity: 0;
  pointer-events: none;
}

.loader-bar {
  width: 120px;
  height: 2px;
  background: rgba(245, 245, 240, 0.08);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.loader-bar-fill {
  height: 100%;
  width: 40%;
  border-radius: 2px;
  background: rgba(245, 245, 240, 0.6);
  box-shadow: 0 0 8px rgba(245, 245, 240, 0.3), 0 0 20px rgba(245, 245, 240, 0.1);
  animation: loaderSlide 1.2s ease-in-out infinite;
}

@keyframes loaderSlide {
  0%   { transform: translateX(-100%); }
  50%  { transform: translateX(200%); }
  100% { transform: translateX(-100%); }
}



/* ============================================================
   MARQUEE / SCROLLING TEXT
   ============================================================ */
.marquee-container {
  overflow: hidden;
  padding: 1.5rem 0;
  border-top: 1px solid var(--gray-mid);
  border-bottom: 1px solid var(--gray-mid);
  margin: 4rem 0;
}

.marquee-track {
  display: flex;
  gap: 3rem;
  animation: marquee 20s linear infinite;
  white-space: nowrap;
}

.marquee-track span {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 300;
  color: var(--gray-light);
  flex-shrink: 0;
}

.marquee-track span.dot {
  font-style: normal;
  color: var(--gray-mid);
}

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ============================================================
   CATEGORY PREVIEWS — /work/ page
   ============================================================ */
.category-previews {
  padding: 2rem 2.5rem 3rem;
  border-bottom: 1px solid var(--gray-mid);
}

.category-previews-scroll {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-previews-scroll::-webkit-scrollbar {
  display: none;
}

.category-card {
  flex: 0 0 auto;
  width: 280px;
  display: block;
  transition: opacity var(--transition-fast);
}

.category-card:hover {
  opacity: 0.7;
}

.category-card-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-bottom: 0.75rem;
}

.category-card-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  filter: grayscale(30%);
  transition: filter 0.4s ease;
}

.category-card:hover .category-card-thumb {
  filter: grayscale(0%);
}

.category-card-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 300;
  font-style: italic;
  margin-bottom: 0.25rem;
}

.category-card-info .label {
  font-size: 0.6rem;
}

/* ============================================================
   MANIFESTO — HOMEPAGE
   ============================================================ */
#manifesto {
  padding: 8rem 2.5rem;
  max-width: 1536px;
  content-visibility: auto;
  contain-intrinsic-size: auto 300px;
  margin: 0 auto;
}

.manifesto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6rem;
  align-items: start;
}

.manifesto-statement {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 3rem);
  font-weight: 300;
  font-style: italic;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.manifesto-body p {
  font-size: 0.85rem;
  line-height: 1.8;
  color: var(--gray-light);
  margin-bottom: 1.5rem;
}

/* ============================================================
   FILTER BUTTONS — archive page
   ============================================================ */
.filter-bar {
  padding: 0 0 2rem;
  display: flex;
  justify-content: center;
  align-items: baseline;
}

.filter-bar--archive {
  justify-content: space-between;
  padding-left: 2.5rem;
  padding-right: 2.5rem;
}

.filter-nav {
  display: flex;
  gap: 1.5rem;
}

.filter-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-light);
  transition: color 0.3s ease;
}

.filter-btn.is-active {
  color: var(--white);
}

.filter-btn:hover {
  color: var(--white);
}

/* ============================================================
   UTILITY
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.separator {
  border: none;
  border-top: 1px solid var(--gray-mid);
  margin: 4rem 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  #site-nav {
    padding: 1.25rem 1.5rem;
  }

  #hero {
    padding: 1.5rem;
  }

  .project-hero {
    padding: var(--nav-height) 1.5rem 1.5rem 1.5rem;
  }

  .project-video-hero {
    padding-left: 0;
    padding-right: 0;
  }

  .hero-title { max-width: 100%; }
  .hero-meta { display: none; }

  #portfolio {
    padding: 2rem 1.5rem 2rem;
  }

  .projects-grid {
    /* Isotope single-column on mobile */
  }

  .project-item,
  .project-item--third,
  .project-item--wide,
  .project-item--narrow,
  .project-item--twothird,
  .project-item--full,
  .grid-sizer {
    width: 100% !important;
  }

  .gutter-sizer {
    width: 0;
  }

  .project-item--full .project-thumb {
    aspect-ratio: 16/9;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  #about {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .project-body {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  /* Header: stack so link buttons fall below the metadata */
  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .project-header-main .project-meta-row {
    padding-bottom: 0;
  }

  .project-links {
    flex-wrap: wrap;
  }

  .similar-projects {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .page-main {
    padding-top: calc(var(--nav-height) + 2rem);
  }

  .archive-main {
    padding-top: calc(var(--nav-height) + 1.5rem);
  }

  .home-main > #portfolio:first-child {
    padding-top: calc(var(--nav-height) + 2rem);
  }

  .page-default-content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .about-right {
    order: -1;
  }

  .about--rental .about-right img {
    max-width: 100%;
    margin-left: 0;
  }

  .project-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1rem;
  }

  .project-meta-row .meta-value:nth-child(even) {
    text-align: end;
  }

  .similar-projects-grid {
    grid-template-columns: 1fr;
  }

  .project-nav {
    flex-direction: column;
  }

  .project-nav-prev {
    border-right: none;
    border-bottom: 1px solid var(--gray-mid);
  }

  .project-nav-next {
    align-items: flex-start;
  }

  #site-footer {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }

  .footer-right { text-align: center; }

  .overlay-menu a {
    font-size: clamp(2.5rem, 12vw, 4rem);
  }

  .manifesto-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .filter-bar {
    padding: 0 0 1.5rem;
    justify-content: center;
  }

  .filter-bar--archive {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .filter-nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .category-card {
    width: 220px;
  }
}

/* ============================================================
   WORDPRESS ALIGNMENT CLASSES
   ============================================================ */
.alignleft { float: left; margin-right: 2rem; margin-bottom: 1rem; }
.alignright { float: right; margin-left: 2rem; margin-bottom: 1rem; }
.aligncenter { display: block; margin: 0 auto 1rem; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 0.7rem; color: var(--gray-light); margin-top: 0.5rem; }
