/* ===================================================================
   Omri Elkayam — DP · Gaffer · Colorist
   Portfolio site — omridp.com
   Dark cinematic palette · bilingual EN/HE (RTL/LTR) · vanilla
   =================================================================== */

:root {
  --bg:          #0a0a0a;
  --bg-elev:     #141414;
  --bg-card:     #121212;
  --line:        #262626;
  --text:        #f4f4f4;
  --text-dim:    #a3a3a3;
  --text-faint:  #6b6b6b;
  --accent:      #e8e2d4;   /* warm off-white, filmic */
  --accent-hover:#ffffff;
  --max:         1200px;
  --nav-h:       72px;
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ----- Direction handling (RTL/LTR via <html lang dir>) ----- */
html[dir="rtl"] body { font-family: 'Inter', 'Segoe UI', 'Arial Hebrew', sans-serif; }

/* ----- Language visibility toggle -----
   Elements carry both .lang-en and .lang-he; JS sets data-lang on <html>. */
html[data-lang="en"] .lang-he { display: none; }
html[data-lang="he"] .lang-en { display: none; }

/* ===================================================================
   Layout helpers
   =================================================================== */
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 32px; }

.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 16px;
}

h1, h2, h3 { line-height: 1.1; font-weight: 600; letter-spacing: -0.01em; }

/* ===================================================================
   Navigation
   =================================================================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(10, 10, 10, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}
.nav .wrap { display: flex; align-items: center; justify-content: space-between; }

.brand { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.04em; }
.brand-role { font-size: 10px; letter-spacing: 0.14em; color: var(--text-faint); text-transform: uppercase; }

.nav-links { display: flex; align-items: center; gap: 32px; }
.nav-links a {
  font-size: 14px;
  color: var(--text-dim);
  transition: color 0.2s var(--ease);
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: ''; position: absolute; bottom: -6px; left: 0; right: 0;
  height: 1px; background: var(--accent);
}

.nav-right { display: flex; align-items: center; gap: 20px; }

.lang-btn {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  background: transparent;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
  font-family: inherit;
}
.lang-btn:hover { color: var(--text); border-color: var(--text-dim); }

.hamburger {
  display: none;
  width: 28px; height: 20px;
  position: relative;
  cursor: pointer;
  background: transparent;
  border: none;
}
.hamburger span {
  position: absolute; left: 0; right: 0; height: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 9px; }
.hamburger span:nth-child(3) { top: 18px; }
.nav.open .hamburger span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.nav.open .hamburger span:nth-child(2) { opacity: 0; }
.nav.open .hamburger span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ===================================================================
   Hero (Home)
   =================================================================== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* Slideshow layer */
.slideshow { position: absolute; inset: 0; z-index: 0; }
.slide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 1.4s var(--ease);
  background-size: cover;
  background-position: center;
}
.slide.active { opacity: 1; }

/* Placeholder frames — dark gradient panels with a label.
   Replace each .slide's background with a real image when available. */
.slide.ph-1 { background: linear-gradient(135deg, #0d0d0f 0%, #1a1a20 100%); }
.slide.ph-2 { background: linear-gradient(135deg, #0f0d0d 0%, #201a1a 100%); }
.slide.ph-3 { background: linear-gradient(135deg, #0d0f0d 0%, #1a201c 100%); }
.slide.ph-4 { background: linear-gradient(135deg, #0d0d12 0%, #171722 100%); }
.slide.ph-5 { background: linear-gradient(135deg, #110d0d 0%, #241a1a 100%); }
.slide.ph-6 { background: linear-gradient(135deg, #0d1012 0%, #182028 100%); }
.slide-label {
  position: absolute; bottom: 32px; inset-inline-end: 32px;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-faint);
}

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

.hero-content { position: relative; z-index: 2; max-width: 760px; }
.hero h1 {
  font-size: clamp(40px, 7vw, 84px);
  margin-bottom: 24px;
}
.hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 12px;
}
.hero-tag {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 36px;
}
.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; }

/* ===================================================================
   Buttons
   =================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; letter-spacing: 0.04em;
  padding: 14px 28px;
  border-radius: 2px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.25s var(--ease);
  border: 1px solid transparent;
}
.btn-primary { background: var(--accent); color: #0a0a0a; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-2px); }
.btn-ghost { border-color: var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--text-dim); background: rgba(255,255,255,0.03); }

/* ===================================================================
   Page header (interior pages)
   =================================================================== */
.page-head { padding-top: calc(var(--nav-h) + 72px); padding-bottom: 48px; }
.page-head h1 { font-size: clamp(34px, 5vw, 56px); margin-bottom: 12px; }
.page-head p { color: var(--text-dim); font-size: 18px; }

/* ===================================================================
   Work grid
   =================================================================== */
.work-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}
.project {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.project:hover { border-color: var(--text-faint); transform: translateY(-3px); }

.project-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.project-thumb iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; display: block;
}
.project-thumb .thumb-label {
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text-faint);
}
.project.coming .project-thumb { background: linear-gradient(135deg, #0f0f12 0%, #181820 100%); }
.coming-badge {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
  background: rgba(10,10,10,0.35);
}

.project-body { padding: 22px 22px 26px; }
.project-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.project-desc { font-size: 14px; color: var(--text-dim); margin-bottom: 16px; line-height: 1.55; }
.project-meta {
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--text-faint); text-transform: uppercase;
}
.project-episodes {
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line);
  display: grid; gap: 6px;
}
.project-episodes li { font-size: 13px; color: var(--text-dim); }

/* ===================================================================
   About
   =================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 56px;
  align-items: start;
}
.about-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
}
.about-body p { color: var(--text-dim); font-size: 17px; margin-bottom: 20px; line-height: 1.7; }
.about-body p:first-child { color: var(--text); }
.about-body strong { color: var(--text); }

.skills {
  margin: 36px 0;
  display: grid; gap: 10px;
}
.skills li {
  font-size: 15px; color: var(--text-dim);
  padding-inline-start: 20px; position: relative;
}
.skills li::before {
  content: ''; position: absolute; inset-inline-start: 0; top: 11px;
  width: 6px; height: 6px; background: var(--accent); border-radius: 50%;
}
.about-close {
  font-size: 20px; color: var(--text); font-weight: 500;
  margin-top: 32px; line-height: 1.4;
}

/* ===================================================================
   Work with Me — role cards
   =================================================================== */
.roles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 56px;
}
.role-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 32px 28px;
  transition: border-color 0.3s var(--ease);
}
.role-card:hover { border-color: var(--text-faint); }
.role-num { font-size: 12px; letter-spacing: 0.2em; color: var(--text-faint); margin-bottom: 14px; }
.role-name { font-size: 24px; font-weight: 600; margin-bottom: 14px; }
.role-desc { font-size: 15px; color: var(--text-dim); line-height: 1.65; }

.match-block { max-width: 680px; }
.match-block h2 { font-size: clamp(26px, 3.5vw, 38px); margin-bottom: 20px; }
.match-block p { font-size: 18px; color: var(--text-dim); margin-bottom: 28px; line-height: 1.7; }

/* ===================================================================
   Contact form
   =================================================================== */
.contact-grid { max-width: 640px; }
.form-field { margin-bottom: 22px; }
.form-field label {
  display: block; font-size: 13px; letter-spacing: 0.04em;
  color: var(--text-dim); margin-bottom: 8px;
}
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  padding: 13px 15px;
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.2s var(--ease);
}
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none; border-color: var(--accent);
}
.form-field textarea { resize: vertical; min-height: 120px; }
.form-field select { appearance: none; cursor: pointer; }

.trust-line {
  margin-top: 32px; padding-top: 28px; border-top: 1px solid var(--line);
  font-size: 15px; color: var(--text-dim); line-height: 1.8;
}
.trust-line a { color: var(--accent); transition: color 0.2s var(--ease); }
.trust-line a:hover { color: var(--accent-hover); }

/* ===================================================================
   Footer
   =================================================================== */
.footer {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  margin-top: 40px;
}
.footer .wrap {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 20px;
}
.footer-brand { font-size: 14px; color: var(--text-dim); }
.footer-links { display: flex; gap: 24px; }
.footer-links a { font-size: 13px; color: var(--text-faint); transition: color 0.2s var(--ease); }
.footer-links a:hover { color: var(--text); }
.footer-copy { font-size: 12px; color: var(--text-faint); width: 100%; }

/* ===================================================================
   Language switch — fade transition
   The visible-language spans/blocks ease their opacity on switch. JS adds
   .lang-fading to <html> for ~200ms around the swap. */
.lang-en, .lang-he { transition: opacity 0.2s var(--ease); }
html.lang-fading .lang-en,
html.lang-fading .lang-he { opacity: 0; }

/* ===================================================================
   Project slideshow (inside a project thumb — e.g. Project 9 stills)
   Same crossfade behavior as the hero slideshow. */
.project-slideshow { position: absolute; inset: 0; }
.project-slideshow .pslide {
  position: absolute; inset: 0;
  opacity: 0;
  transition: opacity 1.2s var(--ease);
  background-size: cover;
  background-position: center;
}
.project-slideshow .pslide.active { opacity: 1; }

/* ===================================================================
   Animations — gentle fade-in
   =================================================================== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ===================================================================
   Responsive — mobile first breakpoint at 768px
   =================================================================== */
@media (max-width: 768px) {
  .wrap { padding: 0 20px; }
  .section { padding: 64px 0; }

  .hamburger { display: block; }
  .nav-links {
    position: fixed;
    top: var(--nav-h); left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    padding: 8px 20px 20px;
    transform: translateY(-120%);
    transition: transform 0.35s var(--ease);
    z-index: 90;
  }
  .nav.open .nav-links { transform: translateY(0); }
  .nav-links a { padding: 16px 0; width: 100%; border-bottom: 1px solid var(--line); font-size: 16px; }
  .nav-links a:last-child { border-bottom: none; }
  .nav-links a.active::after { display: none; }

  .work-grid { grid-template-columns: 1fr; }
  .roles { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; gap: 32px; }
  .about-photo { max-width: 280px; }

  .footer .wrap { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 420px) {
  .hero-cta { flex-direction: column; align-items: stretch; }
  .btn { width: 100%; }
}
