/* ===== דף מותג: הלוגו על שמי הלילה, הסיפור, תמונות ההשראה ודפדוף בין המותגים ===== */

/* ---------- למעלה: כחול לילה, השם במרכז, ומאחוריו השם שוב בענק ובהיר ---------- */
.brand-top {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  min-height: clamp(300px, 38vh, 400px); display: grid; place-items: center;
  padding: clamp(110px, 11vw, 140px) clamp(16px, 5vw, 80px) clamp(40px, 5vw, 70px);
  background: #111a39;
}
.brand-top__ghost {
  position: absolute; inset-inline: 0; top: 50%; transform: translateY(-38%);
  font-size: clamp(110px, 17vw, 260px); font-weight: 900; line-height: 1; white-space: nowrap;
  color: rgba(255, 255, 255, .08); pointer-events: none; user-select: none;
  animation: brand-ghost 1.2s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes brand-ghost { from { opacity: 0; letter-spacing: .08em; } }
.brand-top__text { position: relative; padding-top: clamp(20px, 3vw, 40px); }
.brand-top__name { margin: 0; font-size: clamp(34px, 3.4vw, 50px); font-weight: 900; line-height: 1.1; animation: brand-rise .8s .15s cubic-bezier(.2, .8, .2, 1) both; }
.brand-top__tagline { margin: 12px 0 0; font-size: clamp(19px, 1.65vw, 25px); line-height: 1.45; color: rgba(255, 255, 255, .92); animation: brand-rise .8s .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes brand-rise { from { opacity: 0; transform: translateY(18px); } }

/* ---------- הסיפור ---------- */
.brand-story { padding: clamp(60px, 7vw, 110px) 0 clamp(20px, 3vw, 40px); background: #fff; }
.page-brand .brand-story__inner { max-width: 860px; } /* צר יותר – נוח לקרוא */
.brand-story p { margin: 0 0 1em; font-size: clamp(20px, 1.6vw, 25px); line-height: 1.75; color: #1d3a47; }
/* הפסקה הראשונה גדולה יותר, עם קו בצבעי המותג לפניה */
.brand-story p:first-child {
  position: relative; padding-inline-start: 26px;
  font-size: clamp(24px, 2.1vw, 32px); font-weight: 700; line-height: 1.5; color: var(--blue);
}
.brand-story p:first-child::before {
  content: ""; position: absolute; inset-block: .25em; inset-inline-start: 0; width: 6px; border-radius: 6px;
  background: var(--brand-line, linear-gradient(180deg, #006482, #4eaa48, #d0162d)); /* צבעי המותג של הלקוח, אם נבחרו */
}
.brand-story p.brand-story__soon { padding: 0; font-size: 22px; font-weight: 400; color: #6b8794; text-align: center; }
.brand-story p.brand-story__soon::before { display: none; }

/* ---------- תמונות ההשראה: מקצה לקצה, בלי רווחים ובלי פינות. שתיים זו ליד זו, ואחת לכל הרוחב ---------- */
.brand-inspo { padding: clamp(30px, 4vw, 60px) 0 0; background: #fff; }
.brand-inspo__title { text-align: center; margin-bottom: clamp(26px, 3vw, 44px); }
.brand-inspo__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.brand-inspo__item { position: relative; overflow: hidden; margin: 0; background: #eef3f5; }
.brand-inspo__item.is-half { aspect-ratio: 8 / 7; }
.brand-inspo__item.is-full { grid-column: 1 / -1; width: 100%; height: min(66.6vw, 92vh); } /* כל הרוחב, יחס 3:2 אבל לא גבוהה מהמסך */
.brand-inspo__btn { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.brand-inspo__btn img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.is-half .brand-inspo__btn:hover img { transform: scale(1.04); }
.brand-inspo__btn:focus-visible { outline: 4px solid var(--blue); outline-offset: -4px; }
/* רקע בצבע העיקרי של התמונה, אבל בהיר (מחושב ב-brand.js). נראה מאחורי תמונה שקופה או שלמה במסגרת */
.brand-inspo__item.has-tint { background: radial-gradient(circle at 50% 42%, var(--tint-light) 0%, var(--tint) 85%); }
/* תמונה שלא מתאימה לצורת המסגרת: מוצגת שלמה, עם מרווח קטן מסביב */
.brand-inspo__item.is-fit .brand-inspo__btn img { object-fit: contain; padding: clamp(14px, 3%, 40px); }
.brand-inspo__item.is-fit .brand-inspo__btn img { filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .18)); }
/* כיתוב: תווית קטנה בפינה התחתונה */
.brand-inspo__cap {
  position: absolute; inset-inline-start: clamp(14px, 2vw, 30px); bottom: clamp(14px, 2vw, 30px); max-width: 70%;
  padding: 10px 16px; border-radius: 12px; font-size: clamp(15px, 1.2vw, 18px); font-weight: 700;
  color: var(--cap-fg, #fff); background: var(--cap-bg, rgba(17, 26, 57, .78)); pointer-events: none; /* צבע אקראי מצבעי המותג */
  box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .45);
}
/* הופעה: שתיים שעולות זו אחרי זו; זו שלכל הרוחב נפתחת מהאמצע */
.brand-inspo__item.is-half { opacity: 0; transform: translateY(50px); transition: opacity .8s ease, transform .9s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--d, 0s); }
.brand-inspo__item.is-full { clip-path: inset(8% 6% 8% 6%); transition: clip-path 1.1s cubic-bezier(.2, .8, .2, 1); }
.brand-inspo__item.is-in { opacity: 1; transform: none; clip-path: inset(0); }
@media (max-width: 700px) {
  .brand-inspo__grid { grid-template-columns: 1fr; }
  .brand-inspo__item.is-half, .brand-inspo__item.is-full { aspect-ratio: 4 / 3; height: auto; }
}

/* ---------- דפדוף בין המותגים ---------- */
.brand-nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  padding-block: clamp(30px, 4vw, 60px) clamp(60px, 7vw, 100px);
}
.brand-nav__link {
  display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 18px; text-decoration: none; color: var(--blue);
  background: #f3f7f9; transition: background .2s, transform .2s;
}
.brand-nav__link--next { flex-direction: row-reverse; text-align: left; }
.brand-nav__link:hover, .brand-nav__link:focus-visible { background: #e6eff3; transform: translateY(-2px); }
.brand-nav__link img { width: 96px; aspect-ratio: 800 / 719; object-fit: cover; border-radius: 10px; flex: 0 0 auto; }
.brand-nav__txt { display: grid; gap: 2px; min-width: 0; }
.brand-nav__txt small { font-size: 15px; color: #53707d; } /* כהה מספיק לטקסט קטן (נגישות) */
.brand-nav__txt strong { font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-nav__all {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 28px; border-radius: 999px; text-decoration: none;
  color: var(--blue); font-size: 19px; font-weight: 700; border: 2px solid transparent;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(90deg, #d0162d, #4eaa48 50%, #006482) border-box;
}
.brand-nav__all:hover, .brand-nav__all:focus-visible { transform: scale(1.04); }
.brand-nav a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------- טלפון ---------- */
@media (max-width: 800px) {
  .brand-nav { grid-template-columns: 1fr 1fr; }
  .brand-nav__all { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .brand-nav__link { flex-direction: column; text-align: center; }
  .brand-nav__link--next { flex-direction: column; text-align: center; }
  .brand-nav__link { align-items: center; padding: 12px 8px; }
  .brand-nav__link img { width: 84px; } /* בטלפון הלוגו הקטן לא תופס את כל הכרטיס */
  .brand-nav__txt strong { white-space: normal; font-size: 17px; }
}

/* ---------- בלי תנועה ---------- */
@media (prefers-reduced-motion: reduce) {
  .brand-top__ghost, .brand-top__name, .brand-top__tagline { animation: none; }
  .brand-inspo__item { opacity: 1 !important; transform: none !important; clip-path: none !important; transition: none; }
}
.a11y-still :is(.brand-top__ghost, .brand-top__name, .brand-top__tagline) { animation: none !important; }
.a11y-still .brand-inspo__item { opacity: 1 !important; transform: none !important; clip-path: none !important; }

/* ---------- השם: מסגרת במעבר צבעי המותג שמצטיירת פעם אחת, ואז נצבעת בלבן ונשארת ---------- */
.brand-top__name { animation: none; }
.brand-top__draw { display: block; height: 1.85em; width: auto; max-width: 100%; margin: 0 auto; overflow: visible; }
.brand-top__draw text {
  font-family: "Birzia", Arial, sans-serif; font-weight: 900; font-size: 100px;
  fill: #fff; fill-opacity: 0;
  stroke: url(#nameGrad); stroke-width: 2.2; stroke-linejoin: round;
  stroke-dasharray: var(--dash, 3000); stroke-dashoffset: var(--dash, 3000);
  filter: drop-shadow(0 0 6px rgba(120, 220, 110, .35)) brightness(1.3);
  animation: name-draw 2.6s cubic-bezier(.45, 0, .35, 1) .2s forwards, name-fill .9s ease 2.6s forwards;
}
@keyframes name-draw { to { stroke-dashoffset: 0; } }
@keyframes name-fill { to { fill-opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .brand-top__draw text { animation: none; stroke-dashoffset: 0; fill-opacity: 1; } }
.a11y-still .brand-top__draw text { animation: none !important; stroke-dashoffset: 0 !important; fill-opacity: 1 !important; }

/* ---------- צור קשר (מהסקיל contact-footer): החלק עולה על הדפדוף, אז משאירים מקום לקוליברי ---------- */
.page-brand .brand-nav { padding-bottom: clamp(230px, 22vw, 300px); }

/* ---------- הלוגו עצמו מימין לסיפור (רק אם הועלה בניהול) ----------
   מיושר למעלה, ובגובה של 3 שורות של הפסקה הראשונה */
.page-brand .brand-story__inner.has-logo {
  --line: calc(clamp(24px, 2.1vw, 32px) * 1.5); /* גובה שורה של הפסקה הראשונה */
  max-width: 1180px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: clamp(24px, 3.5vw, 56px);
}
.brand-story__logo { margin: 0; height: calc(var(--line) * 3); position: relative; }
.brand-story__logo img { display: block; height: 100%; width: auto; max-width: 300px; object-fit: contain; }
.brand-story__text > :last-child { margin-bottom: 0; }
@media (max-width: 800px) {
  .page-brand .brand-story__inner.has-logo { grid-template-columns: 1fr; gap: 22px; }
  .brand-story__logo { justify-self: center; }
}

/* ---------- כניסה מיוחדת של הלוגו: נוחת כמו חותמת, טבעת בצבעי המותג מתפשטת ממנו, וברק אור עובר עליו ----------
   מתחיל כשהלוגו מגיע למסך (brand.js מוסיף is-in) */
.brand-story__logo img { opacity: 0; transform: translateY(-60px) rotate(-18deg) scale(1.6); filter: blur(8px); }
.brand-story__logo.is-in img { animation: logo-stamp 1.1s cubic-bezier(.2, .9, .25, 1.35) forwards; }
@keyframes logo-stamp {
  0%   { opacity: 0; transform: translateY(-60px) rotate(-18deg) scale(1.6); filter: blur(8px); }
  55%  { opacity: 1; transform: translateY(4px) rotate(3deg) scale(.92); filter: blur(0); }
  75%  { transform: translateY(-3px) rotate(-1.5deg) scale(1.04); }
  100% { opacity: 1; transform: none; filter: none; }
}
/* הטבעת: מתפשטת מהלוגו ברגע הנחיתה ונעלמת */
.brand-story__logo::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 100%; aspect-ratio: 1; border-radius: 50%;
  translate: -50% -50%; pointer-events: none; opacity: 0;
  background: conic-gradient(from 0deg, #006482, #4eaa48, #d0162d, #006482);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px));
}
.brand-story__logo.is-in::before { animation: logo-ring 1s ease-out .55s forwards; }
@keyframes logo-ring {
  0%   { opacity: .9; transform: scale(.4) rotate(0deg); }
  100% { opacity: 0; transform: scale(1.7) rotate(120deg); }
}
/* ברק אור שעובר על הלוגו אחרי הנחיתה */
.brand-story__logo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .85) 50%, transparent 65%);
  background-size: 250% 100%; background-position: 120% 0;
  -webkit-mask: var(--logo-mask) center / contain no-repeat; mask: var(--logo-mask) center / contain no-repeat;
}
.brand-story__logo.is-in::after { animation: logo-shine 1s ease-in-out 1.15s forwards; }
@keyframes logo-shine {
  0%   { opacity: 1; background-position: 120% 0; }
  100% { opacity: 1; background-position: -20% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-story__logo img { opacity: 1; transform: none; filter: none; }
  .brand-story__logo.is-in img, .brand-story__logo.is-in::before, .brand-story__logo.is-in::after { animation: none; }
}
.a11y-still .brand-story__logo img { opacity: 1 !important; transform: none !important; filter: none !important; animation: none !important; }
.a11y-still .brand-story__logo::before, .a11y-still .brand-story__logo::after { animation: none !important; }


/* ---------- צבעי המותג: טיפות צבע שנוטפות מהלוגו, נוחתות זו מתחת לזו עם אדווה, ואז מתנדנדות בעדינות ---------- */
.brand-story__side { display: grid; justify-items: center; gap: clamp(18px, 2vw, 28px); align-content: start; }
.brand-drops { list-style: none; margin: 0; padding: 0; display: grid; justify-items: center; gap: clamp(12px, 1.4vw, 18px); position: relative; }
/* חוט דק שמצטייר מהלוגו למטה, שעליו הטיפות "גולשות" */
.brand-drops::before {
  content: ""; position: absolute; top: -14px; bottom: 6px; left: 50%; width: 2px; translate: -50% 0; border-radius: 2px;
  background: var(--brand-line, linear-gradient(180deg, #006482, #4eaa48, #d0162d)); opacity: .35;
  transform: scaleY(0); transform-origin: top;
}
.brand-drops.is-in::before { animation: drip-line 1s cubic-bezier(.5, 0, .2, 1) calc(var(--line-d, 1.3s)) forwards; }
@keyframes drip-line { to { transform: scaleY(1); } }
.brand-drops__drop {
  position: relative; width: clamp(40px, 3.6vw, 52px); aspect-ratio: 1; border-radius: 50%; background: var(--c);
  box-shadow: inset -6px -8px 14px rgba(0, 0, 0, .18), inset 6px 6px 12px rgba(255, 255, 255, .35), 0 10px 18px -8px var(--c);
  opacity: 0; transform: translateY(-160px) scale(.4);
}
/* ברק קטן על הטיפה */
.brand-drops__drop::before {
  content: ""; position: absolute; width: 26%; height: 18%; top: 18%; left: 24%; border-radius: 50%;
  background: rgba(255, 255, 255, .7); transform: rotate(-30deg);
}
/* האדווה ברגע הנחיתה */
.brand-drops__drop::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--c); opacity: 0;
}
.brand-drops.is-in .brand-drops__drop {
  animation: drop-fall .9s cubic-bezier(.5, 0, .75, .45) var(--d) forwards,
             drop-bob 3.2s ease-in-out calc(var(--d) + 1.3s + var(--k) * .25s) infinite;
}
.brand-drops.is-in .brand-drops__drop::after { animation: drop-ripple .8s ease-out calc(var(--d) + .55s) forwards; }
@keyframes drop-fall {
  0%   { opacity: 0; transform: translateY(-160px) scale(.4, .55); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; }
  15%  { opacity: 1; }
  55%  { transform: translateY(0) scale(.82, 1.25); }      /* נמתחת בנפילה */
  70%  { transform: translateY(4px) scale(1.25, .72); }    /* נמעכת בנחיתה */
  85%  { transform: translateY(-6px) scale(.92, 1.08); }
  100% { opacity: 1; transform: none; border-radius: 50%; }
}
@keyframes drop-ripple {
  0%   { opacity: .8; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.9); }
}
@keyframes drop-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-5px); }
}
@media (max-width: 800px) {
  .brand-drops { grid-auto-flow: column; }
  .brand-drops::before { top: 50%; bottom: auto; left: 6px; right: 6px; width: auto; height: 2px; translate: 0 -50%; transform: scaleX(0); transform-origin: right; }
  .brand-drops.is-in::before { animation-name: drip-line-x; }
  @keyframes drip-line-x { to { transform: scaleX(1); } }
}
@media (prefers-reduced-motion: reduce) {
  .brand-drops__drop, .brand-drops.is-in .brand-drops__drop { opacity: 1; transform: none; animation: none; }
  .brand-drops::before, .brand-drops.is-in::before { transform: none; animation: none; }
  .brand-drops.is-in .brand-drops__drop::after { animation: none; }
}
.a11y-still .brand-drops__drop { opacity: 1 !important; transform: none !important; animation: none !important; }
.a11y-still .brand-drops::before { transform: none !important; animation: none !important; }
.a11y-still .brand-drops__drop::after { animation: none !important; }

/* the shine and the ring around the logo must not push the page sideways on a phone */
.brand-story { overflow-x: clip; }
/* a computer screen mockup: smaller inside its frame, with room around it */
.brand-inspo__item.is-small .brand-inspo__btn img { object-fit: contain; padding: clamp(40px, 13%, 120px); }
