/* Homepage only: the shared site stylesheet is deliberately untouched.
   Overflow is measured and paginated in js/home-motion.js. Hidden is used for inactive
   states/pages, never to crop the active page's text. */
body.home {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  direction: rtl;
  isolation: isolate;
  background: #082440;
  color: #fff;
  font-family: "Heebo", Arial, "Noto Sans Hebrew", sans-serif;
  font-size: clamp(1rem, .85rem + .25vw, 1.125rem);
  line-height: 1.45;
  --home-gap: clamp(8px, 1.6dvh, 18px);
  --home-edge: clamp(12px, 3vw, 44px);
}
body.home *, body.home *::before, body.home *::after { box-sizing: border-box; }
body.home [hidden] { display: none !important; }
body.home button, body.home a { -webkit-tap-highlight-color: transparent; }
body.home button { font: inherit; cursor: pointer; }
body.home a { color: #fff; overflow-wrap: anywhere; }
body.home a:hover { color: #fff; text-decoration-thickness: 2px; }
body.home :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
body.home h1, body.home h2, body.home h3, body.home p, body.home figure, body.home address { margin: 0; }
body.home h1, body.home h2, body.home h3 { color: #fff; overflow-wrap: anywhere; }
body.home h1, body.home .hero h1 {
  font-size: clamp(1.65rem, 1.15rem + 2.2vw, 3.15rem);
  line-height: 1.2;
  max-width: 24em;
  margin: 0;
  text-wrap: pretty;
}
body.home h2 { font-size: clamp(1.5rem, 1.1rem + 1.7vw, 2.65rem); line-height: 1.2; }
body.home h3 { font-size: clamp(1rem, .9rem + .35vw, 1.25rem); line-height: 1.4; }
body.home .skip {
  position: fixed;
  inset-inline-start: 10px;
  top: 8px;
  max-width: calc(100% - 20px);
  transform: translateY(calc(-100% - 16px));
  z-index: 100;
  background: var(--blue-dark);
  color: #fff;
}
body.home .skip:focus { transform: none; }
body.home .wrap { width: 100%; max-width: 1440px; padding-inline: var(--home-edge); }

/* The navigation stays in normal layout, including at enlarged text sizes.
   Small screens use a wrapping chip grid, not a horizontally scrolling strip. */
body.home .site-header {
  position: relative;
  z-index: 10;
  background: #082440;
  border-bottom: 1px solid #ffffff35;
  min-width: 0;
}
body.home .header-row {
  display: grid;
  grid-template-columns: minmax(60px, 100px) minmax(0, 1fr) minmax(60px, 100px);
  align-items: center;
  gap: clamp(6px, 1vw, 16px);
  padding-block: clamp(8px, 1.5dvh, 16px);
}
body.home .logo { min-width: 0; }
body.home .logo img { width: 100%; height: clamp(30px, 5dvh, 52px); object-fit: contain; }
body.home .nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 12px;
  min-width: 0;
  width: auto;
  order: initial;
}
body.home .nav [role="tablist"] { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; min-width: 0; }
body.home .nav [role="tab"], body.home .nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 36px;
  padding: 5px 9px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: #fff;
  font-size: clamp(.875rem, .8rem + .2vw, 1rem);
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
}
body.home .nav [role="tab"][aria-selected="true"] { background: #fff; color: var(--blue-dark); border-color: #fff; }
body.home .nav [role="tab"]:hover, body.home .nav a:hover { background: #ffffff20; border-color: #ffffff70; }
body.home .nav [role="tab"][aria-selected="true"]:hover { background: var(--soft); color: var(--blue-dark); }
body.home .nav ul.nav-links { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: stretch; gap: 3px; margin: 0; padding: 0; list-style: none; min-width: 0; }
body.home .nav-links li { min-width: 0; }
body.home .nav .phone { background: var(--blue-dark); border-color: #ffffff70; color: #fff; margin: 0; }
body.home .nav .phone:hover { background: var(--blue-dark); color: #fff; }

/* One full-bleed video, with a permanent opaque-enough contrast scrim.
   The home poster also covers the interval before the video controller starts. */
body.home #main { min-width: 0; min-height: 0; position: relative; }
body.home .hero {
  height: 100%;
  min-height: 0;
  min-width: 0;
  position: relative;
  padding: 0;
  background: none;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}
body.home .hero::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  background: #082440 url('/assets/hero/office-bg.jpg') center / cover no-repeat;
  pointer-events: none;
}
body.home .hero > video {
  position: fixed;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}
/* Poster still for states with an empty video path. Same z-index as the video so the
   existing ::before lighting overlay stays on top. Restore a real mp4 on the state to skip this. */
body.home .hero > .hero-still {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
  --still-image: none;
}
body.home .hero > .hero-still::after {
  content: "";
  position: absolute;
  inset: -10%;
  background: var(--still-image) center / cover no-repeat;
  transform-origin: center center;
  animation: hero-kenburns-a 20s ease-in-out infinite alternate;
}
body.home .hero > .hero-still.hero-still--alt::after {
  animation-name: hero-kenburns-b;
}
body.home .hero.is-still > video {
  visibility: hidden;
}
body.home .hero.is-motion-paused .hero-still::after {
  animation-play-state: paused;
}
@keyframes hero-kenburns-a {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.08) translate(-2%, -1.5%); }
}
@keyframes hero-kenburns-b {
  from { transform: scale(1) translate(0, 0); }
  to { transform: scale(1.08) translate(2%, 1.5%); }
}
body.home .hero::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(rgba(8,36,64,.65), rgba(8,36,64,.55) 160px, transparent 360px), rgba(8,36,64,.45); /* same lighting as the live site */
  pointer-events: none;
}
body.home .home-panels {
  position: relative;
  z-index: 2;
  min-width: 0;
  min-height: 0;
  height: 100%;
  width: min(100%, 1040px);
  margin-inline: auto;
  padding: clamp(8px, 2.6dvh, 28px) var(--home-edge) 0;
}
body.home .home-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 4px;
  height: 100%;
  min-height: 0;
  min-width: 0;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
}
body.home .panel-content {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: visible;
  container-type: size;
}
/* Keep the static first panel readable before pagination or with JS disabled. */
body.home .panel-content:not(:has(> .layout-subpage)) {
  display: flex;
  flex-direction: column;
  gap: var(--home-gap);
  overflow: auto;
}
body.home .panel-content:not(:has(> .layout-subpage)) > * {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
}
body.home .layout-subpage {
  height: 100%;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: home-page-in 180ms ease-out;
}
body.home .layout-page-content {
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--home-gap);
  overflow-wrap: anywhere;
}
body.home .layout-page-content > * { flex: 0 0 auto; min-width: 0; max-width: 100%; }
body.home .hero p.lead {
  font-size: clamp(1rem, .92rem + .45vw, 1.3rem);
  line-height: 1.5;
  color: #fff;
  max-width: 46em;
  margin: 0;
}
body.home .hero-portraits { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 12px 32px; margin: 0; }
body.home .hero-person { display: flex; flex-direction: row; align-items: center; gap: 12px; min-width: 0; flex: 1 1 210px; }
body.home .hero-person img, body.home .partner-brief > img {
  flex: 0 1 auto;
  width: clamp(48px, 9dvh, 88px);
  height: clamp(48px, 9dvh, 88px);
  max-height: var(--page-room, 88px);
  max-width: 100%;
  object-fit: contain;
  border: 2px solid #ffffffad;
  border-radius: 50%;
}
body.home .hero-person figcaption { min-width: 0; font-size: clamp(.875rem, .8rem + .25vw, 1rem); line-height: 1.4; }
body.home .hero-person figcaption strong,
body.home .hero-person figcaption span { display: block; }
body.home .hero-person figcaption span { font-weight: 400; opacity: .9; }
body.home.photos-bw .hero-person img, body.home.photos-bw .partner-brief > img,
body.home.theme-photos-bw .hero-person img, body.home.theme-photos-bw .partner-brief > img { filter: grayscale(1); }
body.home.photos-color .hero-person img, body.home.photos-color .partner-brief > img,
body.home.theme-photos-color .hero-person img, body.home.theme-photos-color .partner-brief > img { filter: none; }
body.home .hero .btn-row { display: flex; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 10px; margin: 0; width: auto; }
body.home .hero .btn {
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 8px 16px;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: clamp(.95rem, .9rem + .2vw, 1.1rem);
  line-height: 1.4;
  border: 1px solid #fff;
  border-radius: var(--radius);
  background: #fff;
  color: var(--blue-dark);
}
body.home .hero .btn.primary { background: var(--blue-dark); border-color: #ffffffb3; color: #fff; }
body.home .hero .btn:hover { background: var(--soft); color: var(--blue-dark); }
body.home .hero .btn.primary:hover { background: #074d82; color: #fff; }
body.home .panel-item {
  padding: clamp(6px, 1dvh, 12px) 0;
  border: 0;
  border-bottom: 1px solid #ffffff45;
  background: transparent;
  border-radius: 0;
  min-width: 0;
}
body.home #panel-contact .panel-item a { display: inline-flex; align-items: center; min-height: 44px; }
body.home .service-item { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 18px; }
body.home .service-item h3 { flex: 1 1 65%; }
body.home .service-item a { font-weight: 500; }
body.home .panel-list, body.home .doc-list { display: grid; gap: 5px; list-style: none; padding: 0; margin: 0; }
body.home .doc-list li { display: block; padding: clamp(6px, 1dvh, 12px) 0; border: 0; border-bottom: 1px solid #ffffff45; border-radius: 0; background: transparent; }
body.home .doc-list a { display: block; }
body.home .partner-brief { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
body.home .partner-brief > div { flex: 1 1 220px; min-width: 0; display: grid; gap: 4px; }
body.home .partner-brief a { font-size: clamp(.875rem, .85rem + .2vw, 1rem); }
body.home address { font-style: normal; }
body.home .layout-fragment { min-width: 0; }
body.home .layout-fragment.panel-item, body.home .layout-fragment.btn { padding-block: 2px; }

/* Pager space is reserved even for 1/1, so measuring never changes its own
   available height. Controls live inside their state, separate from the tabs. */
body.home .layout-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
  padding-block: 3px;
  font-size: clamp(.875rem, .8rem + .2vw, 1rem);
}
body.home .layout-pagination button {
  width: 36px;
  min-height: 32px;
  padding: 0 6px;
  border: 1px solid #ffffff8c;
  border-radius: var(--radius);
  background: #082440;
  color: #fff;
  font-size: 1.2em;
  line-height: 1.4;
}
body.home .layout-pagination button:hover:not(:disabled) { background: var(--blue-dark); }
body.home .layout-pagination button:disabled { opacity: .5; cursor: default; }
body.home .layout-pagination[data-single="true"] { visibility: hidden; }
body.home .layout-status { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
body.home .hero > .hero-motion-toggle {
  position: relative;
  z-index: 4;
  justify-self: end;
  max-width: calc(100% - 24px);
  min-height: 32px;
  margin: 2px var(--home-edge) 6px;
  padding: 4px 10px;
  border: 1px solid #ffffff8c;
  border-radius: var(--radius);
  background: #082440;
  color: #fff;
  font-size: clamp(.875rem, .8rem + .2vw, 1rem);
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
body.home .hero > .hero-motion-toggle:hover { background: var(--blue-dark); }
body.home .motion-icon { display: none; }
body.home .site-footer { position: relative; z-index: 10; min-width: 0; padding: 6px 0; border-top: 1px solid #ffffff35; background: #082440; color: #fff; font-size: clamp(.8125rem, .78rem + .15vw, .9375rem); line-height: 1.4; }
body.home .site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; }
body.home .site-footer ul { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
body.home .site-footer a { display: inline-flex; align-items: center; min-height: 24px; color: #fff; }
body.home .footer-mobile-only { display: none; }

@media (max-width: 1100px) {
  body.home .header-row { grid-template-columns: minmax(50px, 80px) minmax(0, 1fr) minmax(50px, 80px); }
  body.home .nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  body.home .nav [role="tablist"] { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  body.home .nav ul.nav-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.home .nav [role="tab"], body.home .nav a { padding-inline: 4px; }
}
@media (max-width: 650px) {
  body.home { --home-gap: 10px; --home-edge: 16px; }
  body.home .header-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 12px; padding-block: 6px; }
  body.home .logo-tal { grid-column: 1; grid-row: 1; justify-self: start; }
  body.home .logo-oren { grid-column: 2; grid-row: 1; justify-self: end; }
  body.home .logo img { width: 120px; height: 38px; }
  body.home .nav { grid-column: 1 / -1; grid-row: 2; }
  body.home .nav ul.nav-links { display: none; }
  body.home .nav [role="tablist"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.home .nav [role="tab"], body.home .nav a { min-height: 34px; padding: 4px 3px; }
  body.home .footer-mobile-only { display: list-item; }
  body.home .home-panels { padding-top: 18px; }
  body.home .layout-subpage { justify-content: flex-start; }
  body.home h1, body.home .hero h1,
  body.home h2 { font-size: 1.625rem; line-height: 1.2; font-weight: 700; }
  body.home .hero p.lead { font-size: 1.0625rem; line-height: 1.5; }
  body.home h3 { font-size: 1.0625rem; font-weight: 700; }
  body.home .panel-item,
  body.home .doc-list li { padding-block: 10px; }
  body.home .service-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 18px; }
  body.home .partner-brief { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
  body.home #panel-contact .panel-item a { min-height: 0; }
  body.home .hero-portraits { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: flex-start; }
  body.home .hero-person { flex-direction: column; align-items: center; text-align: center; gap: 6px; flex-basis: auto; }
  body.home .hero-person figcaption { font-size: .875rem; }
  body.home .hero-person img,
  body.home .partner-brief > img { width: 64px; height: 64px; flex: 0 0 auto; }
  body.home .hero::before { background: linear-gradient(rgba(8,36,64,.62), rgba(8,36,64,.52) 160px, rgba(8,36,64,.4) 440px, transparent 580px); }
  body.home .hero h1, body.home .hero p.lead, body.home .hero-person figcaption { text-shadow: 0 1px 3px rgba(0,0,0,.6), 0 0 12px rgba(0,0,0,.35); }
  body.home .doc-list a,
  body.home #panel-contact .panel-item a { text-decoration: none; font-weight: 500; }
  body.home .doc-list a::after,
  body.home #panel-contact .panel-item a::after { content: "←" / ""; margin-inline-start: 8px; }
  body.home .hero .btn-row .btn { flex: 1 1 auto; white-space: nowrap; }
  body.home .motion-icon { display: inline; }
  body.home .motion-label { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
  body.home .hero > .hero-motion-toggle {
    position: absolute;
    bottom: 6px;
    inset-inline-end: 16px;
    width: 36px;
    height: 36px;
    min-height: 0;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    justify-self: auto;
  }
  body.home .site-footer .wrap { justify-content: center; }
  body.home .copyright { font-size: .9em; }
}
@media (max-height: 480px) and (min-width: 651px) {
  body.home { --home-gap: 6px; --home-edge: 20px; }
  body.home .header-row { padding-block: 4px; }
  body.home .nav [role="tab"], body.home .nav a { min-height: 28px; padding-block: 3px; }
  body.home .home-panels { width: min(100%, 1000px); padding-top: 6px; }
  body.home .hero-person img, body.home .partner-brief > img { width: 44px; height: 44px; }
  body.home .hero-portraits { gap: 12px; }
  body.home .panel-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
  body.home .layout-pagination { padding-block: 0; }
  body.home .layout-pagination button { min-height: 26px; }
  body.home .hero > .hero-motion-toggle { min-height: 26px; margin-block: 0 4px; padding-block: 2px; }
  body.home .site-footer { padding-block: 4px; }
  body.home #panel-contact .panel-item a { min-height: 32px; }
}
@container (max-height: 250px) {
  body.home .layout-page-content { gap: 6px; }
  body.home .panel-item, body.home .doc-list li { padding-block: 4px; }
  body.home .hero-person img, body.home .partner-brief > img { width: 40px; height: min(40px, var(--page-room, 40px)); }
}
@keyframes home-page-in { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  body.home, body.home * { scroll-behavior: auto !important; }
  body.home .layout-subpage { animation: none; }
  body.home *, body.home *::before, body.home *::after { transition: none !important; }
  body.home .hero-still::after { animation: none !important; }
}
