:root {
  /* Matched from the live robertoschilling.com's actual computed styles
     (getComputedStyle via the browser — see docs/decisions.md D14) */
  --bg: #ffffff;
  --text-heading: #252525;
  --text-body: #777777;
  --text-link: #2e2e2e;
  --accent: #f97352; /* Jupiter theme's own button/CTA color (measured on the contact submit button) */
  --border: #e5e5e5;
  --max-width: 1140px;

  --footer-bg: #3d4045;
  --footer-text: #808080;
  --footer-copyright: #d1d1d1;

  /* Re-measured directly off the live Elfsight widget's actual computed styles
     (not the raw config JSON, which mis-led the first pass — --films-overlay-text
     was wrongly set to near-black; the widget's real hover-card text is white). */
  --films-accent: rgb(28, 59, 255);
  --films-overlay-bg: rgba(17, 17, 17, 0.7);
  --films-overlay-text: rgb(255, 255, 255);
  --films-popup-bg: rgb(0, 0, 0);
}

* { box-sizing: border-box; }

/* Live site's nav links carry a js-smooth-scroll class (jQuery-driven);
   native CSS smooth scroll is the equivalent modern approach — D16 */
html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-body);
  font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.66;
}

a { color: var(--text-link); }

h1, h2 { font-weight: 300; }

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background: transparent;
  transition: background-color 0.2s ease;
}

/* Pure white (not the previous #f7f7f7) so the header background matches the
   logo asset's own plate color (sampled: 255,255,255) exactly — otherwise the
   two whites sit a few values apart and read as a visible seam around the logo. */
.site-header.scrolled {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

/* visibility (not just opacity) so the hidden logo link can't be tabbed to or
   clicked while invisible — opacity alone leaves a phantom, invisible tab stop. */
.site-header .brand {
  display: flex;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

/* Hidden until the header goes solid — the logo asset is an opaque white plate,
   so showing it over the transparent/hero header state means a visible white box
   floating on the photo. Only reveal it once the header has its own white
   background to blend into (owner call, not a fidelity match). */
.site-header.scrolled .brand { opacity: 1; visibility: visible; }

/* The logo asset itself is a 172x16 opaque white plate with dark text baked in
   (confirmed via `file` — grayscale, no alpha channel) — matches the live site's
   own "dark-logo" pixel size exactly. No extra CSS box/padding needed; that was
   inflating it into a larger, harder-edged rectangle than the source ever shows. */
.site-header .brand img {
  height: 16px;
  width: auto;
}

/* Padding-based spacing + no letter-spacing — matches the live site's actual
   computed nav link styles (getComputedStyle), not an assumed 0.05em tracking. */
.site-header nav a {
  color: #fff;
  text-decoration: none;
  margin: 0 2px;
  padding: 2px 30px 0;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  transition: color 0.2s ease;
}

.site-header.scrolled nav a { color: var(--text-heading); }

.site-header nav a:hover { color: var(--accent); }

/* Hamburger toggle — desktop-hidden by default, only shown under the mobile
   breakpoint below. Bars follow the same white/dark-on-scroll logic as the nav
   links so it stays legible over both the hero photo and the solid header. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: transform 0.2s ease, opacity 0.2s ease, background-color 0.2s ease;
}

.site-header.scrolled .nav-toggle span { background: var(--text-heading); }

.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Below ~800px the 5-item nav (30px horizontal padding per link) no longer fits
   the header row — collapse it into a hamburger-triggered dropdown instead of
   letting it overflow/wrap. The original WordPress theme (Jupiter) shipped a
   mobile menu by default; this restores equivalent functionality rather than
   dropping it. */
@media (max-width: 800px) {
  .nav-toggle { display: flex; }

  .site-header nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #ffffff;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.25s ease, visibility 0s linear 0.25s;
  }

  .site-header.nav-open nav {
    max-height: 400px;
    visibility: visible;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: max-height 0.25s ease;
  }

  .site-header nav a {
    color: var(--text-heading);
    padding: 16px 1.5rem;
    margin: 0;
    text-align: center;
    border-bottom: 1px solid var(--border);
  }
}

section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 5rem 2rem;
  scroll-margin-top: 70px; /* keeps the fixed header from covering the anchor target */
}

/* Films and Photos are full-viewport-width rows on the live site
   (Films: "mk-fullwidth-true"; Photos: the gallery section itself measures
   full window width, zero side padding) — not the 1140px contained layout
   the other sections use. See docs/decisions.md D15. */
.films, .gallery {
  max-width: none;
  padding: 5rem 0;
}

/* Section headings are centered site-wide (confirmed on Films/Photos/Contact via
   getComputedStyle). No "About" heading — the live site goes straight from the
   logos strip into the bio text, no heading at all; matched here, not added. */
.films h2, .gallery h2, .contact h2 {
  text-align: center;
  padding: 0 2rem;
}

/* Full-bleed hero photo — the live site has no overlaid slide text (no
   RevSlider captions), just the photo + a dark legibility overlay */
.hero {
  max-width: none;
  padding: 0;
  min-height: 100vh;
  position: relative;
  background-color: #000;
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  /* Plain url() first as the fallback for browsers without image-set() support —
     they ignore the invalid second declaration and keep the jpg. Supporting
     browsers use the second declaration and pick webp. */
  background-image: url('/images/hero-eu2020.jpg');
  background-image: image-set(
    url('/images/hero-eu2020.webp') type('image/webp'),
    url('/images/hero-eu2020.jpg') type('image/jpeg')
  );
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

/* "Featured in" trust-badge strip — a single 1200x120 image, centered,
   no border/background, sitting between the hero and About on the live
   site (verified via getBoundingClientRect + computed style). */
.logos {
  text-align: center;
  padding: 3rem 2rem;
}

.logos img {
  max-width: 100%;
  height: auto;
}

h2 {
  color: var(--text-heading);
  font-size: 44px;
  line-height: 1.3;
  margin: 0 0 25px;
}

/* Structure and exact type values re-measured directly off the live site's DOM
   (getComputedStyle) after the first fix pass: the bio is a bold lead sentence
   (h1, 18px/700) followed by regular paragraphs (16px/400) — not one undifferentiated
   block — and 3 of those paragraphs carry real links (IMDB, Spotify, Metasonica)
   that the first pass had dropped as plain text. */
/* The live site actually leaves this block left-flush inside a wider centered row
   (measured: an 8-of-12-column layout, not intentionally centered content) — but per
   explicit owner feedback that this reads as mis-aligned rather than deliberate, it's
   centered here as a readability call, not a fidelity one. */
.about .bio {
  max-width: 703px; /* measured off the live site's actual rendered width */
  margin: 0 auto;
}

.about .bio h1 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: #404040;
  margin: 0 0 16px;
}

.about .bio p {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.66;
  color: var(--text-body);
  margin: 0 0 20px;
}

.about .bio p:last-child { margin-bottom: 0; }

.about .bio a { text-decoration: none; }

/* Grid columns/aspect-ratio match the live site's Elfsight config exactly
   (gridColumns: 3, gridItemAspectRatio: 0.669); gap set to 0 per direct visual
   review — the "gridGutter: 10" config value reads as a white seam between
   black video tiles, which looks wrong in practice regardless of the source
   config, and doesn't match the zero-gap Photos grid beside it. */
.films-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin-top: 2rem;
}

@media (max-width: 600px) {
  .films-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* projectLook: "overlay" — thumbnail with a hover-reveal info overlay,
   projectClickAction: "popup" — click opens the video in a lightbox */
.film-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.669;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}

.film-card picture,
.gallery-item picture {
  display: block;
  width: 100%;
  height: 100%;
}

.film-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.2s ease;
}

.film-card:hover .film-poster,
.film-card:focus-visible .film-poster {
  transform: scale(1.05);
  filter: grayscale(100%);
}

/* Text is centered (both axes) and fades in with a slight upward slide — matches
   the live Elfsight widget's actual hover-card behavior, not a flat static overlay. */
.film-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
  padding: 10px;
  background: var(--films-overlay-bg);
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
}

.film-card:hover .film-overlay,
.film-card:focus-visible .film-overlay {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 0.05s;
}

.film-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--films-overlay-text);
}

.film-role {
  margin: 0;
  font-size: 15px;
  color: var(--films-overlay-text);
}

/* Corrected after a fuller DOM search: the live lightbox DOES have a full-screen
   backdrop (an <a class="eap-project-viewer-frame-overlay"> the earlier pass missed
   because it only checked <div>s with position:fixed — this one is position:absolute
   and an <a>). rgba(17,17,17,0.9), dimming the site header underneath it too (the
   header isn't exempted — standard modal behavior). Video card still sits in a
   letterboxed frame near the top, that part was correct. See docs/decisions.md. */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 90px 2rem 3rem;
  background: rgba(17, 17, 17, 0.9);
}

.lightbox-overlay[hidden] { display: none; }

.lightbox-content {
  position: relative;
  width: 100%;
  max-width: 1200px;
  background: var(--films-popup-bg);
}

.lightbox-content video,
.lightbox-content img.lightbox-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 140px);
}

/* Photos grid layout (columns/gutter) still matches the live WPBakery gallery
   shortcode (D15), but the hover treatment below now deliberately matches the
   Films grid's hover (grayscale+scale image, centered fade+slide text) instead
   of the source's own plain fade-in — owner call for visual consistency between
   the two grids, not a fidelity match. */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

.gallery-item {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 0.98;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #000;
  cursor: pointer;
  overflow: hidden;
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease, filter 0.2s ease;
}

.gallery-item:hover .gallery-thumb,
.gallery-item:focus-visible .gallery-thumb {
  transform: scale(1.05);
  filter: grayscale(100%);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(17, 17, 17, 0.7);
  opacity: 0;
  transform: translate3d(0, 10px, 0);
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-align: center;
}

.gallery-item:hover .gallery-overlay,
.gallery-item:focus-visible .gallery-overlay {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  transition-delay: 0.05s;
}

.gallery-item-title {
  margin: 0;
  font-size: 18px; /* matches .film-title, for consistency between the two grids */
  font-weight: 700;
  color: #fff;
}

/* Plain icon buttons, no background plate, fixed to the viewport corners/edges —
   matches the live site's own viewer controls. White (not the live site's dark-gray)
   because the backdrop is dark here too: the dark-gray was only legible on the live
   site because that measurement was taken assuming a light background behind it,
   which turned out to be wrong (see the .lightbox-overlay backdrop fix above). */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  z-index: 31;
}

.lightbox-close svg,
.lightbox-prev svg,
.lightbox-next svg {
  fill: currentColor;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--accent);
}

.lightbox-close { top: 78px; right: 18px; } /* clears the fixed header (~68px tall) */
.lightbox-prev { top: 50%; left: 8px; transform: translateY(-50%) scaleX(-1); }
.lightbox-next { top: 50%; right: 8px; transform: translateY(-50%); }

.lightbox-prev[hidden],
.lightbox-next[hidden] { display: none; }

.films-loading, .films-error {
  color: var(--text-body);
}

/* The live site's contact form is horizontally centered as a block (confirmed:
   its left/right margins are equal) — unlike the About bio, this one really is
   centered on the source, not just a readability call. */
.contact-form {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  gap: 0.35rem;
  margin: 1.5rem auto 0;
}

.contact-form label { color: var(--text-body); font-size: 0.9rem; margin-top: 0.75rem; }

.contact-form input,
.contact-form textarea {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-heading);
  padding: 0.6rem 0.75rem;
  border-radius: 0;
  font-family: inherit;
  font-size: 1rem;
}

.contact-form button {
  margin-top: 1.5rem;
  align-self: flex-start;
  padding: 17px 30px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 3px;
  cursor: pointer;
}

.site-footer {
  text-align: center;
  padding: 2rem;
  background: var(--footer-bg);
  color: var(--footer-text);
  font-size: 14px;
}

.site-footer p {
  color: var(--footer-copyright);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}
