/* ============================================================
   תיק העבודות של רן נוריאני - עיצוב
   שני מותגים באותו גיליון: ברירת המחדל היא רן (נייבי, טורקיז, ענבר -
   הצבעים מהלוגו ומ-DESIGN.md של no-film.ai). html[data-brand="wizman"]
   מחליף לפלטה נייטרלית עד שיתקבלו הצבעים של הסוכנות.
   ============================================================ */

:root {
  --ink: #0c1118;
  --ink-2: #10161f;
  --panel: #151c27;
  --line: #273140;
  --fg: #e9eef1;
  --muted: #8b95a5;
  --accent: #2fc4b2;
  --accent-deep: #1ca893;
  --cta: #f7b030;
  --cta-fg: #14110a;
  --grain: .05;
  --radius: 6px;
  --gap: 14px;
  --font: "Heebo", system-ui, sans-serif;
  --mono: "Azeret Mono", ui-monospace, monospace;
  color-scheme: dark;
}

html[data-brand="wizman"] {
  --ink: #0b0b0c;
  --ink-2: #101011;
  --panel: #171718;
  --line: #2a2a2c;
  --fg: #f3f0e9;
  --muted: #908c84;
  --accent: #f3f0e9;
  --accent-deep: #cfcac0;
  --cta: #f3f0e9;
  --cta-fg: #0b0b0c;
  --grain: .07;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* גריין קולנועי עדין על כל הדף, כמו באתר של רן */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { width: min(1280px, 100% - 40px); margin-inline: auto; }
@media (max-width: 640px) { .wrap { width: calc(100% - 32px); } }

/* ---------- סרגל עליון ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--ink) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
.top .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
}
.mark {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -.01em;
}
.mark svg { width: 30px; height: 30px; flex: none; }
/* הלוגו של נו פילם (מספר המותג, שקוף) בכותרת של רן */
.mark .nf-logo { height: 34px; width: auto; flex: none; }
/* הלוגו המלא של הסוכנות (שחור על לבן) - היפוך צבעים כדי שיישב על הרקע הכהה */
.mark .wm-full { height: 34px; width: auto; flex: none; filter: invert(1); }
.mark small { font-weight: 400; color: var(--muted); white-space: nowrap; }
.mark .latin { font-weight: 900; letter-spacing: .22em; font-size: 14px; direction: ltr; white-space: nowrap; }
@media (max-width: 640px) {
  .mark .latin { font-size: 12px; letter-spacing: .18em; }
  .mark .latin + small { display: none; }
}
/* הלוגו של A Wise Man Creative House: תמונת הפרופיל + הטקסט שבתוכה, באותו סגנון */
.mark .wm-logo { width: 38px; height: 38px; border-radius: 8px; flex: none; }
.mark .wm-word { display: grid; line-height: 1.05; direction: ltr; text-align: left; }
.mark .wm-word b { font-weight: 900; font-size: 15px; letter-spacing: -.01em; }
.mark .wm-word i { font-style: normal; font-weight: 400; font-size: 10.5px; color: var(--muted); letter-spacing: .06em; }
.mark .wm-word + small::before { content: ""; display: inline-block; width: 1px; height: 18px; background: var(--line); margin-inline: 4px 12px; vertical-align: middle; }
.foot-brand { display: inline-flex; align-items: center; gap: 12px; }
.foot-brand .wm-full { height: 44px; width: auto; filter: invert(1); opacity: .9; }
@media (max-width: 640px) {
  .mark .wm-word b { font-size: 13px; }
  .mark .wm-word + small { display: none; }
}
.top-link {
  text-decoration: none;
  font-weight: 500;
  color: var(--fg);
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}
.top-link:hover { border-color: var(--accent); }

/* ---------- הירו: הפרסומת מתנגנת מאחורי הכותרת ---------- */
.hero {
  position: relative;
  min-height: min(100svh, 920px);
  display: grid;
  align-items: end;
  overflow: hidden;
  isolation: isolate;
}
.hero-media {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: var(--ink-2) center / cover no-repeat;
}
.hero-media iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, 177.78vh);
  height: max(100vh, 56.25vw);
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}
.hero-media iframe.ready { opacity: 1; }
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, var(--ink) 0%, color-mix(in srgb, var(--ink) 78%, transparent) 38%, color-mix(in srgb, var(--ink) 30%, transparent) 70%, color-mix(in srgb, var(--ink) 55%, transparent) 100%);
}
.hero .wrap { padding-block: 120px 56px; }
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(44px, 9vw, 128px);
  font-weight: 900;
  line-height: .95;
  letter-spacing: -.03em;
  max-width: 14ch;
}
/* כותרת לטינית בדף עברי: נשארת מיושרת לימין, עם ריווח אותיות קל לאותיות גדולות */
.hero h1.latin-title {
  direction: ltr;
  text-align: right;
  letter-spacing: -.01em;
  font-size: clamp(38px, 7.2vw, 104px);
  max-width: 12ch;
  margin-inline-start: auto;
}
.hero p {
  margin: 0;
  max-width: 44ch;
  font-size: clamp(17px, 1.6vw, 22px);
  font-weight: 400;
  line-height: 1.5;
  color: color-mix(in srgb, var(--fg) 88%, transparent);
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  margin-top: 36px;
  color: var(--muted);
  font-size: 15px;
}
.hero-meta strong { color: var(--fg); font-weight: 700; }
.hero-meta .playing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.hero-meta .playing i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent);
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse { to { box-shadow: 0 0 0 10px transparent; } }
@media (prefers-reduced-motion: reduce) { .hero-meta .playing i { animation: none; } }

/* ---------- לוגואי לקוחות ---------- */
.brands {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--ink-2);
}
.brands .wrap {
  display: grid;
  gap: 14px;
  padding-block: 24px;
}
.brands .label { color: var(--muted); font-size: 14px; }
/* קרוסלה נעה: הרשימה כפולה, והמסילה נעה חצי מרוחבה בלולאה (המנוע ב-portfolio.js, כולל גרירה
   באצבע ובעכבר). בקצוות דהייה לרקע. */
.brands-viewport {
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.brands ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  align-items: center;
  gap: 64px;
  width: max-content;
  will-change: transform;
}
.brands-viewport.dragging { cursor: grabbing; }
@media (prefers-reduced-motion: reduce) {
  .brands ul { flex-wrap: wrap; width: auto; gap: 18px 40px; }
  .brands-viewport { cursor: default; }
  .brands li[aria-hidden="true"] { display: none; }
  .brands-viewport { mask-image: none; -webkit-mask-image: none; }
}
.brands li { display: flex; align-items: center; height: 48px; flex: none; }
.brands img {
  height: 42px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}
/* לוגואים חד-צבעיים שחורים (מוויקימדיה) - מולבנים כדי להיראות על הרקע הכהה */
.brands img[src*="adidas"], .brands img[src*="kfc"] { filter: invert(1); }
.brands .txt {
  font-weight: 900;
  font-size: 20px;
  letter-spacing: .01em;
  white-space: nowrap;
}

/* ---------- הספרייה ---------- */
.library { padding-block: 40px 40px; }

/* סינון: שקט, בלי מספרים. הפעיל מסומן בטקסט בהיר וקו דק, לא במילוי */
.filters {
  position: sticky;
  top: 64px;
  z-index: 15;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 10px 0;
  margin-bottom: 26px;
  background: linear-gradient(var(--ink) 80%, transparent);
}
.filters::-webkit-scrollbar { display: none; }
.filters button {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 500;
  transition: color .15s, border-color .15s;
}
.filters button:hover { color: var(--fg); }
.filters button[aria-pressed="true"] {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

/* שנה = פרק. המספר הגדול הוא ציר הזמן עצמו */
.year { margin-bottom: 56px; }
.year-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: 18px;
}
.year-head h3 {
  margin: 0;
  font-family: var(--mono);
  font-weight: 500;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -.04em;
  color: var(--fg);
  direction: ltr;
}
.year-head .rule { flex: 1; height: 1px; background: var(--line); }
.year-head .count { color: var(--muted); font-size: 14px; white-space: nowrap; }

.grid-wrap { container-type: inline-size; }
.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: calc((100cqw - 3 * var(--gap)) / 4 * 1.125);
  grid-auto-flow: dense;
  gap: var(--gap);
}
@media (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: calc((100cqw - var(--gap)) / 2 * 1.125);
  }
}

.card {
  position: relative;
  grid-column: span 2;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  text-align: right;
  color: var(--fg);
}
.card.vertical { grid-column: span 1; grid-row: span 2; }
.card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s cubic-bezier(.32,.72,0,1);
}
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, color-mix(in srgb, var(--ink) 92%, transparent) 0%, color-mix(in srgb, var(--ink) 40%, transparent) 34%, transparent 62%);
  transition: opacity .3s;
}
.card-text {
  position: absolute;
  inset-inline: 16px;
  bottom: 14px;
  z-index: 2;
  display: grid;
  gap: 2px;
}
.card-text strong {
  font-size: clamp(16px, 1.5vw, 21px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.card-text span { font-size: 13.5px; color: color-mix(in srgb, var(--fg) 72%, transparent); }
.card-date {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 70%, transparent);
  backdrop-filter: blur(6px);
  font-size: 12.5px;
  font-weight: 500;
  color: color-mix(in srgb, var(--fg) 85%, transparent);
}
.card-dur {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ink) 70%, transparent);
  font-family: var(--mono);
  font-size: 11.5px;
  direction: ltr;
  color: color-mix(in srgb, var(--fg) 85%, transparent);
}
.card-play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .25s;
}
.card-play i {
  display: grid;
  place-items: center;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--ink);
  transform: scale(.9);
  transition: transform .25s;
}
.card-play svg { width: 24px; height: 24px; margin-inline-start: 3px; }
.card:hover img, .card:focus-visible img { transform: scale(1.035); }
.card:hover .card-play, .card:focus-visible .card-play { opacity: 1; }
.card:hover .card-play i { transform: scale(1); }
@media (prefers-reduced-motion: reduce) {
  .card img, .card-play i { transition: none; }
  .card:hover img { transform: none; }
}
@media (hover: none) { .card-play { opacity: .9; } .card-play i { width: 52px; height: 52px; } }

.empty { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- פנייה ---------- */
.cta {
  border-top: 1px solid var(--line);
  background: var(--ink-2);
}
.cta .wrap {
  display: grid;
  gap: 22px;
  padding-block: 72px 80px;
}
.cta h2 {
  margin: 0;
  font-size: clamp(32px, 5vw, 64px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.025em;
  max-width: 16ch;
}
.cta p { margin: 0; color: var(--muted); max-width: 52ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 26px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  border: 1px solid transparent;
}
.btn-main { background: var(--cta); color: var(--cta-fg); }
.btn-main:hover { filter: brightness(1.06); }
.btn-ghost { border-color: var(--line); color: var(--fg); }
.btn-ghost:hover { border-color: var(--accent); }
.btn svg { width: 18px; height: 18px; }
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13.5px;
}
.foot a { text-decoration: none; }
.foot a:hover { color: var(--fg); }

/* ---------- חלון הניגון ---------- */
/* החלון נפתח עם dialog.show() ולא showModal(): וידאו בתוך השכבה העליונה של
   הדפדפן (top layer) צויר שחור. לכן המיקום והרקע כאן, ולא ב-::backdrop. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  margin: 0;
  padding: 0;
  border: 0;
  background: color-mix(in srgb, var(--ink) 97%, transparent);
  color: var(--fg);
}
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
}
.lb-bar .pos { font-family: var(--mono); font-size: 12px; color: var(--muted); direction: ltr; }
.lb-x, .lb-nav {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 80%, transparent);
  cursor: pointer;
}
.lb-x:hover, .lb-nav:hover { border-color: var(--accent); }
.lb-x svg, .lb-nav svg { width: 20px; height: 20px; }
.lb-stage {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 14px;
  padding-inline: 16px;
  min-height: 0;
}
.lb-frame {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: min(1200px, calc((100vh - 230px) * 16 / 9));
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
}
.lb-frame.vertical {
  max-width: min(440px, calc((100vh - 230px) * 9 / 16));
  aspect-ratio: 9 / 16;
}
.lb-frame.instagram iframe { height: calc(100% + 100px); }
.lb-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.lb-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 6px 22px;
  padding: 18px 20px 24px;
  text-align: center;
}
.lb-info strong { font-size: 20px; font-weight: 700; }
.lb-info span { color: var(--muted); }
.lb-info .note { flex-basis: 100%; color: color-mix(in srgb, var(--fg) 80%, transparent); max-width: 60ch; margin-inline: auto; }
@media (max-width: 640px) {
  .lb-stage { grid-template-columns: 1fr; padding-inline: 10px; }
  .lb-nav { display: none; }
  .lb-frame { max-width: 100%; }
  .lb-frame.vertical { max-width: min(100%, calc((100vh - 210px) * 9 / 16)); }
}
