/* ============================================================
   Eden Hadad — two-mode site
   Modes are switched by [data-mode="film"|"ai"] on <html>
   ============================================================ */

:root {
  /* AI (default) palette */
  --bg: #05070a;
  --fg: #c8f6d0;
  --muted: #5a7a66;
  --accent: #4ad29a;
  --line: rgba(74, 210, 154, 0.18);
  --card: rgba(20, 30, 25, 0.55);
  --card-hover: rgba(20, 30, 25, 0.85);
  --font-display: "JetBrains Mono", ui-monospace, monospace;
  --font-body: "JetBrains Mono", ui-monospace, monospace;
  --tracking: 0.02em;
}

html[data-mode="film"] {
  --bg: #100904;
  --fg: #efe2cf;
  --muted: #8a7560;
  --accent: #d8a25e;
  --line: rgba(216, 162, 94, 0.22);
  --card: rgba(28, 18, 10, 0.55);
  --card-hover: rgba(28, 18, 10, 0.85);
  --font-display: "Playfair Display", "Times New Roman", serif;
  --font-body: "Inter", system-ui, sans-serif;
  --tracking: 0.005em;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; width: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  letter-spacing: var(--tracking);
  overflow-x: hidden;
  transition: background 600ms ease, color 600ms ease;
  min-height: 100vh;
  line-height: 1.55;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  display: block;
  opacity: 0.85;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.55) 100%);
}

.page, .bar {
  position: relative;
  z-index: 2;
}

/* -------------------- TOP BAR -------------------- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px clamp(20px, 5vw, 60px);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.brand {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg);
}

html[data-mode="film"] .brand-ai,
html[data-mode="ai"] .brand-film {
  display: none;
}

/* -------------------- TOGGLE -------------------- */
.toggle {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  padding: 4px;
  transition: border-color 300ms ease, background 300ms ease;
}
.toggle:hover { background: var(--card); }

.toggle-track {
  position: relative;
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 96px;
  height: 28px;
  border-radius: 999px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.toggle-label {
  text-align: center;
  z-index: 2;
  transition: color 300ms ease;
  pointer-events: none;
}

html[data-mode="ai"] .toggle-label-ai { color: var(--bg); }
html[data-mode="ai"] .toggle-label-film { color: var(--muted); }
html[data-mode="film"] .toggle-label-film { color: var(--bg); }
html[data-mode="film"] .toggle-label-ai { color: var(--muted); }

.toggle-knob {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transition: transform 350ms cubic-bezier(0.7, 0, 0.2, 1), background 600ms ease;
  z-index: 1;
}

html[data-mode="ai"] .toggle-knob { transform: translateX(100%); }
html[data-mode="film"] .toggle-knob { transform: translateX(0%); }

/* -------------------- MODE-SPECIFIC VISIBILITY -------------------- */
html[data-mode="film"] .hero-ai,
html[data-mode="film"] .lede-ai,
html[data-mode="film"] .section-title-ai,
html[data-mode="film"] .foot-ai { display: none; }

html[data-mode="ai"] .hero-film,
html[data-mode="ai"] .lede-film,
html[data-mode="ai"] .section-title-film,
html[data-mode="ai"] .foot-film { display: none; }

/* -------------------- PAGE LAYOUT -------------------- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(40px, 8vh, 100px) clamp(20px, 5vw, 60px) 80px;
}

.hero {
  padding-top: clamp(40px, 10vh, 120px);
  padding-bottom: clamp(40px, 8vh, 80px);
  max-width: 760px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 7vw, 88px);
  line-height: 1.05;
  margin-bottom: 28px;
  color: var(--fg);
}

html[data-mode="film"] .hero h1 { font-style: italic; }

.prompt {
  color: var(--accent);
  margin-right: 16px;
}

.cursor {
  display: inline-block;
  color: var(--accent);
  animation: blink 1s steps(2) infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.lede {
  font-size: clamp(16px, 1.6vw, 19px);
  color: var(--fg);
  opacity: 0.9;
  max-width: 60ch;
}

/* -------------------- SECTIONS -------------------- */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 700;
  margin: clamp(40px, 7vh, 80px) 0 28px;
  color: var(--accent);
  letter-spacing: 0.06em;
}

html[data-mode="film"] .section-title { font-style: italic; letter-spacing: 0.02em; }

/* -------------------- GRID / CARDS -------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 22px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 170px;
  text-decoration: none;
  color: var(--fg);
  transition: transform 250ms ease, background 250ms ease, border-color 250ms ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.card:hover {
  transform: translateY(-3px);
  background: var(--card-hover);
  border-color: var(--accent);
}

.card-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--fg);
}

html[data-mode="film"] .card-title { font-style: italic; font-size: 22px; }

.card-desc {
  font-size: 13.5px;
  color: var(--fg);
  opacity: 0.75;
  line-height: 1.5;
}

.card-meta {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-family: "JetBrains Mono", monospace;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* -------------------- FILM VIDEO PLAYER -------------------- */
.grid.grid-videos {
  grid-template-columns: 1fr;
  gap: 0;
}

.film-video { margin-bottom: clamp(36px, 6vh, 64px); }

.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.video-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.video-caption { margin-top: 16px; }
.video-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 700;
  color: var(--fg);
}
html[data-mode="film"] .video-title { font-style: italic; }
.video-meta {
  margin-top: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.video-desc {
  margin-top: 10px;
  font-size: 15px;
  color: var(--fg);
  opacity: 0.82;
  max-width: 62ch;
}

/* -------------------- CONTACT -------------------- */
.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
}

.contact-row a {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 200ms ease, border-color 200ms ease;
}
.contact-row a:hover { color: var(--accent); border-color: var(--accent); }

/* -------------------- FOOTER -------------------- */
.foot {
  margin-top: clamp(60px, 12vh, 120px);
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}

/* -------------------- RESPONSIVE -------------------- */
@media (max-width: 600px) {
  .bar { padding: 16px 20px; }
  .toggle-track { width: 80px; height: 26px; }
  .grid { grid-template-columns: 1fr; }
}
