/* ================================================================
   Max Jandora — shared styles for all pages
================================================================ */
:root {
  --white:    #FFFFFF;
  --ink:      #111111;
  --red:      #8C0D0D;
  --stone:    #6B6560;
  --rule:     #E2E0DE;
  --surface:  #F7F6F4;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --max: 1360px;
  --pad: clamp(1.5rem, 5vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { background: var(--white); color: var(--ink); font-family: var(--font-body); font-weight: 300; line-height: 1.6; overflow-x: hidden; }
img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 3px; }

/* ---------------- NAV ---------------- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.5rem var(--pad);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.5s var(--ease-out), border-color 0.5s;
}
/* "solid" = white bar: after scrolling on the homepage, always on other pages */
/* over the video: no dark band, just a soft shadow behind the white text */
nav:not(.scrolled) .nav-logo, nav:not(.scrolled) .nav-links a { text-shadow: 0 1px 10px rgba(0,0,0,0.45); }
body.plain nav .nav-logo, body.plain nav .nav-links a { text-shadow: none; }
nav.scrolled, body.plain nav {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-color: var(--rule);
}
.nav-logo {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase; color: #fff; transition: color 0.2s; white-space: nowrap;
}
.nav-logo:hover { color: var(--red); }
nav.scrolled .nav-logo, body.plain .nav-logo { color: var(--ink); }
nav.scrolled .nav-logo:hover, body.plain .nav-logo:hover { color: var(--red); }
.nav-links { display: flex; align-items: center; gap: 2.5rem; list-style: none; }
.nav-links a { font-size: 0.68rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.75); transition: color 0.2s; }
.nav-links a:hover { color: #fff; }
nav.scrolled .nav-links a, body.plain .nav-links a { color: var(--stone); }
nav.scrolled .nav-links a:hover, body.plain .nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--ink) !important; }
.nav-right { display: flex; align-items: center; gap: 0.75rem; }
.lang-toggle { display: flex; border: 1px solid rgba(255,255,255,0.4); border-radius: 2px; overflow: hidden; transition: border-color 0.5s; }
nav.scrolled .lang-toggle, body.plain .lang-toggle { border-color: var(--rule); }
.lang-toggle button { background: transparent; border: none; color: rgba(255,255,255,0.75); font-family: var(--font-body); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 0.35rem 0.7rem; cursor: pointer; transition: background 0.2s, color 0.2s; }
nav.scrolled .lang-toggle button, body.plain .lang-toggle button { color: var(--stone); }
.lang-toggle button.active,
nav.scrolled .lang-toggle button.active,
body.plain .lang-toggle button.active { background: var(--red); color: #fff; }

/* Mobile menu button (hidden on desktop) */
.menu-btn { display: none; background: transparent; border: 1px solid rgba(255,255,255,0.4); color: #fff; font-family: var(--font-body); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 0.35rem 0.7rem; border-radius: 2px; cursor: pointer; }
nav.scrolled .menu-btn, body.plain .menu-btn, nav.menu-open .menu-btn { color: var(--ink); border-color: var(--rule); }

/* ---------------- HERO (homepage) ---------------- */
#hero { position: relative; height: 100svh; min-height: 600px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.hero-video-layer { position: absolute; inset: 0; background: #0a0a0a; overflow: hidden; }
/* The reel is a 16:9 file whose picture is widescreen (--pic-ratio) with bars
   burned in. The frame is scaled so the PICTURE covers the hero and the bars
   fall outside the screen, at any window shape. */
.hero-frame {
  position: absolute; top: 50%; left: 50%;
  aspect-ratio: 16 / 9;
  width: max(100%, calc(var(--pic-ratio, 1.7778) * 100vh), calc(var(--pic-ratio, 1.7778) * 600px));
  width: max(100%, calc(var(--pic-ratio, 1.7778) * 100svh), calc(var(--pic-ratio, 1.7778) * 600px));
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.hero-frame > img, .hero-frame > iframe, .hero-frame > video {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: none;
  border: 0; object-fit: cover;
}
.hero-frame > iframe, .hero-frame > video { opacity: 0; transition: opacity 0.9s var(--ease-out); }
.hero-frame > .playing { opacity: 1; }
.hero-veil { position: absolute; inset: 0; background: rgba(0,0,0,0.38); z-index: 1; pointer-events: none; }
.hero-content { position: relative; z-index: 3; padding: 0 var(--pad) clamp(3rem, 6vh, 5rem); max-width: var(--max); width: 100%; margin: 0 auto; }
.hero-eyebrow { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: #e84040; margin-bottom: 1rem; }
.hero-name { font-family: var(--font-display); font-size: clamp(4rem, 10vw, 10.5rem); font-weight: 300; line-height: 0.88; color: #fff; text-shadow: 0 2px 32px rgba(0,0,0,0.5); }
.hero-name em { font-style: italic; color: rgba(255,255,255,0.65); }
.hero-sub { margin-top: 1.5rem; font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: rgba(255,255,255,0.9); }
.hero-cta { display: none; margin-top: 2rem; }
.hero-cta.visible { display: flex; align-items: center; gap: 0.75rem; }
.btn-play { display: inline-flex; align-items: center; gap: 0.6rem; font-size: 0.65rem; letter-spacing: 0.16em; text-transform: uppercase; color: #fff; border: 1px solid rgba(255,255,255,0.7); padding: 0.6rem 1.2rem 0.6rem 1rem; border-radius: 2px; cursor: pointer; background: transparent; transition: background 0.2s, color 0.2s, border-color 0.2s; font-family: var(--font-body); }
.btn-play:hover { background: var(--red); border-color: var(--red); }
.btn-play svg { width: 12px; height: 12px; fill: currentColor; flex-shrink: 0; }
.scroll-hint { position: absolute; bottom: 2.5rem; right: var(--pad); z-index: 3; display: flex; align-items: center; gap: 0.8rem; font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.scroll-line { width: 36px; height: 1px; background: rgba(255,255,255,0.6); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scaleX(1)}50%{opacity:.35;transform:scaleX(.45)} }

/* ---------------- SHARED SECTION CHROME ---------------- */
.section-wrap { max-width: var(--max); margin: 0 auto; padding: clamp(5rem,8vw,8rem) var(--pad); }
.section-label { display: inline-flex; align-items: center; gap: 0.75rem; font-size: 0.58rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--red); margin-bottom: 2.5rem; }
.section-label::after { content:''; width: 40px; height: 1px; background: var(--red); opacity: 0.5; }
h1.page-title, h2 { font-family: var(--font-display); font-weight: 300; line-height: 1.05; }
h2 { font-size: clamp(2.2rem,4.5vw,4rem); }
h1.page-title { font-size: clamp(2.8rem,6vw,5.5rem); }
h1.page-title em, h2 em { font-style: italic; color: var(--stone); }
.text-link { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.65rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink); border-bottom: 1px solid var(--red); padding-bottom: 0.3rem; transition: color 0.2s; }
.text-link:hover { color: var(--red); }
.btn-outline { display: inline-flex; align-items: center; gap: 0.6rem; background: transparent; border: 1px solid var(--ink); color: var(--ink); font-family: var(--font-body); font-size: 0.65rem; letter-spacing: 0.16em; text-transform: uppercase; padding: 0.75rem 1.3rem; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s; border-radius: 2px; }
.btn-outline:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------------- HOME: ABOUT ---------------- */
#about .section-wrap { display: grid; grid-template-columns: 1fr 1.3fr; gap: clamp(3rem,6vw,7rem); align-items: start; }
.about-photo { margin-top: 2rem; width: 100%; aspect-ratio: 4/5; overflow: hidden; background: var(--surface); border-top: 3px solid var(--red); }
.about-photo img { width: 100%; height: 100%; object-fit: cover; object-position: left center; transition: transform 0.6s var(--ease-out); }
.about-photo:hover img { transform: scale(1.03); }
.about-right { padding-top: 4.5rem; }
.about-text { font-size: 0.95rem; color: var(--stone); line-height: 1.8; }
.about-text p + p { margin-top: 1.25rem; }
.about-more { margin-top: 2rem; }
.timeline { margin-top: 3.5rem; border-top: 1px solid var(--rule); }
.timeline-item { display: grid; grid-template-columns: 80px 1fr; gap: 1.5rem; padding: 1.25rem 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.timeline-year { font-size: 0.6rem; letter-spacing: 0.12em; color: var(--red); font-weight: 400; }
.timeline-title { font-size: 0.85rem; color: var(--ink); font-weight: 400; margin-bottom: 0.2rem; }
.timeline-detail { font-size: 0.72rem; color: var(--stone); line-height: 1.5; }

/* ---------------- HOME: WORK ---------------- */
#work .section-wrap { padding-bottom: 0; }
.work-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 3.5rem; gap: 1.5rem; flex-wrap: wrap; }
.filter-tabs { display: flex; border: 1px solid var(--rule); border-radius: 2px; overflow: hidden; }
.filter-tab { background: transparent; border: none; color: var(--stone); font-family: var(--font-body); font-size: 0.62rem; letter-spacing: 0.14em; text-transform: uppercase; padding: 0.5rem 1rem; cursor: pointer; transition: background 0.2s, color 0.2s; }
.filter-tab.active { background: var(--red); color: #fff; }
.projects-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.project-card { position: relative; overflow: hidden; background: var(--surface); cursor: pointer; aspect-ratio: 16/10; }
.project-card[data-hidden="true"] { display: none; }
.project-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; transition: transform 0.65s var(--ease-out); }
.project-card:hover .project-thumb { transform: scale(1.04); }
.project-placeholder { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: var(--surface); font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; color: #ccc; padding: 1rem; text-align: center; }
.project-overlay { position: absolute; inset: 0; background: linear-gradient(to top, rgba(17,17,17,0.85) 0%, transparent 55%); opacity: 0; transition: opacity 0.3s; display: flex; flex-direction: column; justify-content: flex-end; padding: 1.75rem; }
.project-card:hover .project-overlay,
.project-card:focus-visible .project-overlay { opacity: 1; }
/* Phones and tablets have no hover — always show the titles there */
@media (hover: none) { .project-overlay { opacity: 1; } }
.project-tag { font-size: 0.52rem; letter-spacing: 0.18em; text-transform: uppercase; color: #e06060; margin-bottom: 0.4rem; }
.project-title { font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; color: #fff; line-height: 1.15; }
.project-year { font-size: 0.6rem; color: rgba(255,255,255,0.5); margin-top: 0.3rem; }

/* ---------------- HOME: CONTACT ---------------- */
#contact .section-wrap { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(3rem,7vw,8rem); align-items: start; }
.contact-tagline { font-family: var(--font-display); font-size: clamp(2rem,3.5vw,3.2rem); font-weight: 300; line-height: 1.15; margin-bottom: 2.5rem; }
.contact-tagline em { font-style: italic; color: var(--stone); }
.contact-links { display: flex; flex-direction: column; }
.contact-link { display: flex; align-items: center; gap: 1.5rem; padding: 1.1rem 0; border-bottom: 1px solid var(--rule); color: var(--stone); font-size: 0.85rem; transition: color 0.2s; }
.contact-link:hover { color: var(--ink); }
.contact-link-label { font-size: 0.55rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red); width: 72px; flex-shrink: 0; }
.contact-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-field { display: flex; flex-direction: column; gap: 0.4rem; }
.form-label { font-size: 0.58rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red); }
.form-input { background: transparent; border: none; border-bottom: 1px solid var(--rule); padding: 0.6rem 0; font-family: var(--font-body); font-size: 0.85rem; font-weight: 300; color: var(--ink); outline: none; transition: border-color 0.2s; width: 100%; resize: none; }
.form-input:focus { border-color: var(--ink); }
.form-textarea { min-height: 100px; line-height: 1.6; }
.form-submit { align-self: flex-start; margin-top: 0.5rem; }
.form-submit:disabled { opacity: 0.5; cursor: default; }
.form-note { font-size: 0.7rem; color: var(--stone); line-height: 1.5; }
.form-note a { border-bottom: 1px solid var(--rule); }
.form-note a:hover { color: var(--ink); border-color: var(--red); }
.form-status { font-size: 0.78rem; color: var(--ink); min-height: 1.2em; }
.contact-photo { margin-top: 2rem; width: 100%; aspect-ratio: 4/3; overflow: hidden; background: var(--surface); }
.contact-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------- ABOUT PAGE ---------------- */
.page-head { max-width: var(--max); margin: 0 auto; padding: calc(6rem + 5vw) var(--pad) clamp(3rem,5vw,4.5rem); display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(2rem,6vw,6rem); align-items: end; }
.page-intro { font-size: 1rem; color: var(--stone); line-height: 1.8; max-width: 34rem; }
.wide-photo { max-width: var(--max); margin: 0 auto; padding: 0 var(--pad); }
.wide-photo figure { aspect-ratio: 21/9; overflow: hidden; background: var(--surface); border-top: 3px solid var(--red); }
.wide-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 35%; }
.chapters { border-top: 1px solid var(--rule); }
.chapter { display: grid; grid-template-columns: minmax(8rem, 1fr) 2.2fr; gap: clamp(1.5rem,5vw,5rem); padding: clamp(2rem,4vw,3rem) 0; border-bottom: 1px solid var(--rule); }
.chapter-when { font-family: var(--font-display); font-size: clamp(2rem,3.5vw,3rem); font-weight: 300; line-height: 1; color: var(--red); }
.chapter-title { font-family: var(--font-body); line-height: 1.4; font-size: 0.95rem; font-weight: 400; color: var(--ink); margin-bottom: 0.75rem; }
.chapter-text { font-size: 0.95rem; color: var(--stone); line-height: 1.8; max-width: 40rem; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.fact { padding: 1.75rem 1.5rem 1.75rem 0; }
.fact + .fact { padding-left: 1.5rem; border-left: 1px solid var(--rule); }
.fact-label { font-size: 0.55rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--red); margin-bottom: 0.6rem; }
.fact-value { font-size: 0.85rem; color: var(--ink); line-height: 1.55; }
.page-cta { display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.page-cta p { font-family: var(--font-display); font-size: clamp(1.8rem,3vw,2.6rem); font-weight: 300; line-height: 1.15; }
.page-cta p em { font-style: italic; color: var(--stone); }

/* ---------------- LEGAL PAGE ---------------- */
.legal { max-width: 46rem; margin: 0 auto; padding: calc(6rem + 5vw) var(--pad) clamp(4rem,7vw,6rem); }
.legal .updated { font-size: 0.72rem; color: var(--stone); margin-top: 1rem; }
.legal section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--rule); scroll-margin-top: 6rem; }
.legal h2 { font-size: clamp(1.6rem,2.6vw,2.1rem); margin-bottom: 1rem; }
.legal p, .legal li { font-size: 0.9rem; color: var(--stone); line-height: 1.8; }
.legal p + p, .legal p + ul, .legal ul + p { margin-top: 0.9rem; }
.legal ul { padding-left: 1.1rem; }
.legal li + li { margin-top: 0.35rem; }
.legal strong { color: var(--ink); font-weight: 400; }
.legal a { color: var(--ink); border-bottom: 1px solid var(--red); }
.legal dl { display: grid; grid-template-columns: 7rem 1fr; gap: 0.5rem 1rem; font-size: 0.9rem; margin-top: 1rem; }
.legal dt { font-size: 0.58rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--red); padding-top: 0.35rem; }
.legal dd { color: var(--ink); }

/* ---------------- FOOTER ---------------- */
footer { border-top: 1px solid var(--rule); padding: 1.75rem var(--pad); display: flex; align-items: center; justify-content: space-between; gap: 1rem; max-width: var(--max); margin: 0 auto; }
.footer-copy { font-size: 0.62rem; letter-spacing: 0.1em; color: #999; }
.footer-links { display: flex; gap: 1.75rem; }
.footer-links a { font-size: 0.6rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--stone); transition: color 0.2s; }
.footer-links a:hover { color: var(--red); }

/* ---------------- LIGHTBOX ---------------- */
.lightbox { display: none; position: fixed; inset: 0; z-index: 200; background: rgba(17,17,17,0.96); align-items: center; justify-content: center; padding: 2rem; }
.lightbox.open { display: flex; }
.lightbox-inner { position: relative; max-width: 920px; width: 100%; }
.lightbox-close { position: absolute; top: -2.5rem; right: 0; background: none; border: none; color: #aaa; font-size: 0.62rem; letter-spacing: 0.18em; text-transform: uppercase; cursor: pointer; transition: color 0.2s; font-family: var(--font-body); }
.lightbox-close:hover { color: #fff; }
.lightbox-media { aspect-ratio: 16/9; background: #000; width: 100%; overflow: hidden; }
.lightbox-media iframe, .lightbox-media video { width: 100%; height: 100%; border: none; }
.lightbox-meta { margin-top: 1.25rem; }
.lightbox-title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 300; color: #fff; }
.lightbox-desc { margin-top: 0.4rem; font-size: 0.78rem; color: #9a938d; line-height: 1.6; }

/* ---------------- REVEAL ---------------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-d1 { transition-delay: 0.08s; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 960px) {
  #about .section-wrap, #contact .section-wrap, .page-head { grid-template-columns: 1fr; gap: 3rem; }
  .about-right { padding-top: 0; }
  .projects-grid { grid-template-columns: 1fr 1fr; }
  .wide-photo figure { aspect-ratio: 16/10; }
}
@media (max-width: 640px) {
  nav { padding: 1.1rem 1.5rem; }
  .menu-btn { display: inline-block; }
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: #fff; border-bottom: 1px solid var(--rule); padding: 0.5rem 1.5rem 1rem;
  }
  nav.menu-open { background: #fff; border-color: var(--rule); }
  nav.menu-open .nav-links { display: flex; }
  nav.menu-open .nav-logo { color: var(--ink); }
  nav.menu-open .lang-toggle { border-color: var(--rule); }
  nav.menu-open .lang-toggle button:not(.active) { color: var(--stone); }
  .nav-links li { width: 100%; }
  .nav-links a, nav.scrolled .nav-links a, body.plain .nav-links a { display: block; padding: 0.9rem 0; color: var(--ink); font-size: 0.72rem; border-bottom: 1px solid var(--rule); }
  .nav-links li:last-child a { border-bottom: none; }
  .projects-grid { grid-template-columns: 1fr; }
  .chapter { grid-template-columns: 1fr; gap: 0.75rem; }
  .facts { grid-template-columns: 1fr; }
  .fact, .fact + .fact { padding: 1.25rem 0; border-left: none; }
  .fact + .fact { border-top: 1px solid var(--rule); }
  .legal dl { grid-template-columns: 1fr; gap: 0.1rem; }
  .legal dd { margin-bottom: 0.6rem; }
  footer { flex-direction: column; gap: 0.9rem; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}
.section-wrap.tight-top { padding-top: 0; }
