/* שכבת תנועה (הממד הרביעי) מעל שכבת העומק.
   רק transform ו-opacity. טקסט רץ ושדות קלט לא זזים.
   prefers-reduced-motion מכבה הכול. */

@property --float-y {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

:root {
  --orient-x: 0deg;
  --orient-y: 0deg;
  --enter-y: 0px;
  --enter-z: 0px;
  --enter-scale: 1;
}

/* הילות מותג שנעות לאט כל הזמן */
.site-halo {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
  will-change: transform;
}

.site-halo-a {
  width: min(78vw, 720px);
  height: min(78vw, 720px);
  top: -8%;
  right: -18%;
  background: radial-gradient(circle, rgba(140, 197, 64, 0.28) 0%, transparent 70%);
  animation: halo-drift-a 18s ease-in-out infinite;
}

.site-halo-b {
  width: min(68vw, 600px);
  height: min(68vw, 600px);
  top: 38%;
  left: -22%;
  background: radial-gradient(circle, rgba(0, 122, 158, 0.22) 0%, transparent 70%);
  animation: halo-drift-b 22s ease-in-out infinite;
}

.site-halo-c {
  width: min(50vw, 420px);
  height: min(50vw, 420px);
  bottom: -12%;
  right: 18%;
  background: radial-gradient(circle, rgba(29, 58, 18, 0.14) 0%, transparent 72%);
  animation: halo-drift-c 26s ease-in-out infinite;
}

@keyframes halo-drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-48px, 36px, 0) scale(1.08); }
}
@keyframes halo-drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(40px, -32px, 0) scale(1.06); }
}
@keyframes halo-drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-28px, -24px, 0) scale(1.1); }
}

body:not(.alu-page) .site-header,
body:not(.alu-page) main,
body:not(.alu-page) .site-footer,
.alu-page .alu-top,
.alu-page .alu-wrap,
.alu-page .alu-foot,
.page-shell {
  position: relative;
  z-index: 1;
}

@keyframes float-soft {
  0%, 100% { --float-y: 0px; }
  50% { --float-y: -8px; }
}
@keyframes float-softer {
  0%, 100% { --float-y: 0px; }
  50% { --float-y: -5px; }
}


@keyframes shine-logo {
  0%, 8% {
    background-position: -60% 50%;
    opacity: 0;
  }
  22% { opacity: 1; }
  42%, 100% {
    background-position: 160% 50%;
    opacity: 0;
  }
}

@keyframes shine-sweep {
  0%, 8% {
    background-position: -60% 50%;
    opacity: 0;
  }
  22% { opacity: 0.55; }
  42%, 100% {
    background-position: 160% 50%;
    opacity: 0;
  }
}

.calc-tiles .calc-open {
  --float-y: 0px;
  --enter-y: 0px;
  --enter-z: 0px;
  --enter-scale: 1;
  transform: perspective(920px)
    rotateX(calc(var(--tilt-x, 0deg) + var(--orient-x, 0deg)))
    rotateY(calc(var(--tilt-y, 0deg) + var(--orient-y, 0deg)))
    translateY(calc(var(--lift, 0px) + var(--float-y, 0px) + var(--enter-y, 0px)))
    translateZ(var(--enter-z, 0px))
    scale(var(--enter-scale, 1));
  animation: float-soft 4.6s ease-in-out infinite;
}

.calc-tiles .calc-open:nth-child(1) { animation-delay: 0s; }
.calc-tiles .calc-open:nth-child(2) { animation-delay: 0.18s; }
.calc-tiles .calc-open:nth-child(3) { animation-delay: 0.36s; }
.calc-tiles .calc-open:nth-child(4) { animation-delay: 0.54s; }
.calc-tiles .calc-open:nth-child(5) { animation-delay: 0.12s; }
.calc-tiles .calc-open:nth-child(6) { animation-delay: 0.3s; }
.calc-tiles .calc-open:nth-child(7) { animation-delay: 0.48s; }
.calc-tiles .calc-open:nth-child(8) { animation-delay: 0.66s; }
.calc-tiles .calc-open:nth-child(9) { animation-delay: 0.24s; }
.calc-tiles .calc-open:nth-child(10) { animation-delay: 0.42s; }

.calc-tiles .calc-open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  background-image: linear-gradient(
    105deg,
    transparent 0%,
    transparent 36%,
    rgba(255, 255, 255, 0.36) 50%,
    transparent 64%,
    transparent 100%
  );
  background-repeat: no-repeat;
  background-size: 46% 160%;
  background-position: -60% 50%;
  opacity: 0;
  animation: shine-logo 5.2s ease-in-out infinite;
}

.calc-tiles .calc-open:nth-child(1)::after { animation-delay: 0s; }
.calc-tiles .calc-open:nth-child(2)::after { animation-delay: 0.45s; }
.calc-tiles .calc-open:nth-child(3)::after { animation-delay: 0.9s; }
.calc-tiles .calc-open:nth-child(4)::after { animation-delay: 1.35s; }
.calc-tiles .calc-open:nth-child(5)::after { animation-delay: 0.25s; }
.calc-tiles .calc-open:nth-child(6)::after { animation-delay: 0.7s; }
.calc-tiles .calc-open:nth-child(7)::after { animation-delay: 1.15s; }
.calc-tiles .calc-open:nth-child(8)::after { animation-delay: 1.6s; }
.calc-tiles .calc-open:nth-child(9)::after { animation-delay: 0.5s; }
.calc-tiles .calc-open:nth-child(10)::after { animation-delay: 0.95s; }

.index-tile {
  --float-y: 0px;
  --enter-y: 0px;
  --enter-scale: 1;
  transform: translateY(calc(var(--float-y, 0px) + var(--enter-y, 0px))) scale(var(--enter-scale, 1));
  animation: float-softer 5.4s ease-in-out infinite;
}
.index-tile:nth-child(1), .index-tile-item:nth-child(1) .index-tile { animation-delay: 0s; }
.index-tile-item:nth-child(2) .index-tile { animation-delay: 0.22s; }
.index-tile-item:nth-child(3) .index-tile { animation-delay: 0.44s; }
.index-tile-item:nth-child(4) .index-tile { animation-delay: 0.66s; }

.index-tile:hover,
.index-tile:focus-visible {
  transform: translateY(calc(-3px + var(--float-y, 0px) + var(--enter-y, 0px))) scale(var(--enter-scale, 1));
}
.index-tile:active {
  transform: translateY(1px);
  animation: none;
}

.contact-cta,
.alu-result-card,
.hon-result,
.zak-result,
.mec-result,
.tz-result,
.calc-res {
  --float-y: 0px;
  --enter-y: 0px;
  --enter-z: 0px;
  --enter-scale: 1;
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --lift: 0px;
  transform: perspective(1100px)
    rotateX(calc(var(--tilt-x, 0deg) + var(--orient-x, 0deg)))
    rotateY(calc(var(--tilt-y, 0deg) + var(--orient-y, 0deg)))
    translateY(calc(var(--lift, 0px) + var(--float-y, 0px) + var(--enter-y, 0px)))
    translateZ(var(--enter-z, 0px))
    scale(var(--enter-scale, 1));
}

.contact-cta.tilt-nw, .alu-result-card.tilt-nw, .hon-result.tilt-nw, .zak-result.tilt-nw, .mec-result.tilt-nw, .tz-result.tilt-nw, .calc-res.tilt-nw { --tilt-x: 5deg; --tilt-y: -6deg; }
.contact-cta.tilt-n,  .alu-result-card.tilt-n,  .hon-result.tilt-n,  .zak-result.tilt-n,  .mec-result.tilt-n,  .tz-result.tilt-n,  .calc-res.tilt-n  { --tilt-x: 5deg; --tilt-y: 0deg; }
.contact-cta.tilt-ne, .alu-result-card.tilt-ne, .hon-result.tilt-ne, .zak-result.tilt-ne, .mec-result.tilt-ne, .tz-result.tilt-ne, .calc-res.tilt-ne { --tilt-x: 5deg; --tilt-y: 6deg; }
.contact-cta.tilt-w,  .alu-result-card.tilt-w,  .hon-result.tilt-w,  .zak-result.tilt-w,  .mec-result.tilt-w,  .tz-result.tilt-w,  .calc-res.tilt-w  { --tilt-x: 0deg; --tilt-y: -6deg; }
.contact-cta.tilt-mid,.alu-result-card.tilt-mid,.hon-result.tilt-mid,.zak-result.tilt-mid,.mec-result.tilt-mid,.tz-result.tilt-mid,.calc-res.tilt-mid { --tilt-x: 1.5deg; --tilt-y: 0deg; }
.contact-cta.tilt-e,  .alu-result-card.tilt-e,  .hon-result.tilt-e,  .zak-result.tilt-e,  .mec-result.tilt-e,  .tz-result.tilt-e,  .calc-res.tilt-e  { --tilt-x: 0deg; --tilt-y: 6deg; }
.contact-cta.tilt-sw, .alu-result-card.tilt-sw, .hon-result.tilt-sw, .zak-result.tilt-sw, .mec-result.tilt-sw, .tz-result.tilt-sw, .calc-res.tilt-sw { --tilt-x: -5deg; --tilt-y: -6deg; }
.contact-cta.tilt-s,  .alu-result-card.tilt-s,  .hon-result.tilt-s,  .zak-result.tilt-s,  .mec-result.tilt-s,  .tz-result.tilt-s,  .calc-res.tilt-s  { --tilt-x: -5deg; --tilt-y: 0deg; }
.contact-cta.tilt-se, .alu-result-card.tilt-se, .hon-result.tilt-se, .zak-result.tilt-se, .mec-result.tilt-se, .tz-result.tilt-se, .calc-res.tilt-se { --tilt-x: -5deg; --tilt-y: 6deg; }

/* כניסה בלבד — בלי ציפה או הטיה, כדי שלא יזוזו שדות קלט וטקסט רץ */
html.js-motion .site-header.motion-enter,
html.js-motion .alu-top.motion-enter,
html.js-motion .logo-link.motion-enter,
html.js-motion .alu-brand.motion-enter,
html.js-motion .tmh-crumbs.motion-enter,
html.js-motion .alu-nav.motion-enter,
html.js-motion .glossary.motion-enter,
html.js-motion .gloss.motion-enter,
html.js-motion .alu-explain.motion-enter,
html.js-motion .alu-rates.motion-enter,
html.js-motion .tmh-yearly.motion-enter,
html.js-motion .tmh-table-wrap.motion-enter,
html.js-motion .tmh-chart-wrap.motion-enter,
html.js-motion .tmh-panel.motion-enter,
html.js-motion .alu-form-card.motion-enter,
html.js-motion .tz-card.motion-enter,
html.js-motion .detail-pane.motion-enter,
html.js-motion .site-footer.motion-enter,
html.js-motion .alu-foot.motion-enter,
html.js-motion .page-shell.motion-enter,
html.js-motion .refinance.motion-enter,
html.js-motion .index-tile-item.motion-enter,
html.js-motion .alu-yellow.motion-enter {
  --enter-y: 0px;
  --enter-scale: 1;
  transform: translateY(var(--enter-y, 0px)) scale(var(--enter-scale, 1));
}

.contact-cta {
  animation: float-softer 6.2s ease-in-out infinite;
}

.contact-cta::after,
.alu-result-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  background-image: linear-gradient(
    105deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.2) 50%,
    transparent 60%,
    transparent 100%
  );
  background-repeat: no-repeat;
  background-size: 40% 180%;
  background-position: -60% 50%;
  opacity: 0;
  animation: shine-sweep 6.4s ease-in-out infinite 0.8s;
}

/* כניסה מעומק */
html.js-motion .motion-enter:not(.is-inview) {
  --enter-y: 22px;
  --enter-z: 0px;
  --enter-scale: 1;
  animation: none;
}

/* רק אריחי מחשבונים ומדדים נכנסים גם בדהייה, כדי שתוכן חיוני לא ייעלם אם אין גלילה */
html.js-motion .calc-tiles .calc-open.motion-enter:not(.is-inview),
html.js-motion .index-tile-item.motion-enter:not(.is-inview) {
  --enter-y: 28px;
  --enter-z: 0px;
  --enter-scale: 1;
  opacity: 0;
  animation: none;
}


html.js-motion .motion-enter {
  transition: transform 0.7s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease;
}

html.js-motion .motion-enter:focus-within {
  --enter-y: 0px;
  --enter-z: 0px;
  --enter-scale: 1;
  opacity: 1 !important;
}


html.js-motion .motion-enter.is-inview {
  --enter-y: 0px;
  --enter-z: 0px;
  --enter-scale: 1;
  opacity: 1;
}

html.js-motion .motion-enter.is-inview:nth-child(1) { transition-delay: 0ms; }
html.js-motion .motion-enter.is-inview:nth-child(2) { transition-delay: 60ms; }
html.js-motion .motion-enter.is-inview:nth-child(3) { transition-delay: 120ms; }
html.js-motion .motion-enter.is-inview:nth-child(4) { transition-delay: 180ms; }
html.js-motion .motion-enter.is-inview:nth-child(5) { transition-delay: 80ms; }
html.js-motion .motion-enter.is-inview:nth-child(6) { transition-delay: 140ms; }
html.js-motion .motion-enter.is-inview:nth-child(7) { transition-delay: 200ms; }
html.js-motion .motion-enter.is-inview:nth-child(8) { transition-delay: 260ms; }
html.js-motion .motion-enter.is-inview:nth-child(9) { transition-delay: 100ms; }
html.js-motion .motion-enter.is-inview:nth-child(10) { transition-delay: 160ms; }

html.js-motion .calc-tiles .calc-open.is-inview:hover,
html.js-motion .calc-tiles .calc-open.is-inview:focus-visible {
  transition-duration: 0.22s;
  transition-delay: 0s;
}

html.ox-n2 { --orient-x: -4deg; }
html.ox-n1 { --orient-x: -2deg; }
html.ox-0 { --orient-x: 0deg; }
html.ox-p1 { --orient-x: 2deg; }
html.ox-p2 { --orient-x: 4deg; }
html.oy-n2 { --orient-y: -4deg; }
html.oy-n1 { --orient-y: -2deg; }
html.oy-0 { --orient-y: 0deg; }
html.oy-p1 { --orient-y: 2deg; }
html.oy-p2 { --orient-y: 4deg; }

/* שדות קלט וטקסט רץ לעולם לא מקבלים transform מתנועה */
input, select, textarea, p, li, td, th, label, legend, figcaption {
  --float-y: 0px;
  --enter-y: 0px;
  --enter-z: 0px;
}

@media (prefers-reduced-motion: reduce) {
  .site-halo,
  .calc-tiles .calc-open,
  .calc-tiles .calc-open::after,
  .index-tile,
  .contact-cta,
  .contact-cta::after,
  .alu-result-card::after,
  .logo-link::after,
  .alu-page .alu-brand::after,
  .logo-link::before,
  .alu-page .alu-brand::before,
  .alu-form-card,
  .alu-result-card,
  .tmh-panel,
  .hon-result,
  .zak-result,
  .mec-result,
  .tz-result,
  .tz-card,
  .calc-res,
  .detail-pane,
  .contact-btn,
  .refinance-btn,
  .alu-page .alu-pdf,
  .alu-page .alu-kind {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  html.js-motion .motion-enter:not(.is-inview) {
    --enter-y: 0px;
    --enter-z: 0px;
    --enter-scale: 1;
    opacity: 1 !important;
  }
}

@media print {
  .site-halo,
  .calc-tiles .calc-open::after,
  .contact-cta::after,
  .alu-result-card::after,
  .logo-link::after,
  .alu-page .alu-brand::after,
  .logo-link::before,
  .alu-page .alu-brand::before {
    display: none !important;
  }
  .calc-tiles .calc-open,
  .index-tile,
  .index-tile-item,
  .contact-cta,
  .alu-form-card,
  .alu-result-card,
  .tmh-panel,
  .hon-result,
  .zak-result,
  .mec-result,
  .tz-result,
  .tz-card,
  .calc-res,
  .detail-pane,
  .gloss,
  .contact-btn,
  .refinance-btn,
  .logo-link,
  .alu-page .alu-brand,
  .motion-enter {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
    box-shadow: none !important;
  }
}


/* לוגו: אותו הבזק כמו באריחים, חתוך לצורת התמונה, והטיה במעבר עכבר */
.logo-link,
.alu-page .alu-brand {
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.logo-link:hover,
.logo-link:focus-visible,
.alu-page .alu-brand:hover,
.alu-page .alu-brand:focus-visible {
  --lift: -4px;
}
.logo-link:active,
.alu-page .alu-brand:active {
  --lift: 0px;
}
.logo-link.tilt-nw, .alu-page .alu-brand.tilt-nw { --tilt-x: 6deg; --tilt-y: -7deg; }
.logo-link.tilt-n,  .alu-page .alu-brand.tilt-n  { --tilt-x: 6deg; --tilt-y: 0deg; }
.logo-link.tilt-ne, .alu-page .alu-brand.tilt-ne { --tilt-x: 6deg; --tilt-y: 7deg; }
.logo-link.tilt-w,  .alu-page .alu-brand.tilt-w  { --tilt-x: 0deg; --tilt-y: -7deg; }
.logo-link.tilt-mid,.alu-page .alu-brand.tilt-mid { --tilt-x: 2deg; --tilt-y: 0deg; }
.logo-link.tilt-e,  .alu-page .alu-brand.tilt-e  { --tilt-x: 0deg; --tilt-y: 7deg; }
.logo-link.tilt-sw, .alu-page .alu-brand.tilt-sw { --tilt-x: -6deg; --tilt-y: -7deg; }
.logo-link.tilt-s,  .alu-page .alu-brand.tilt-s  { --tilt-x: -6deg; --tilt-y: 0deg; }
.logo-link.tilt-se, .alu-page .alu-brand.tilt-se { --tilt-x: -6deg; --tilt-y: 7deg; }

.logo-link::after,
.alu-page .alu-brand::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 3;
  background-image: linear-gradient(
    105deg,
    transparent 0%,
    transparent 32%,
    rgba(255, 255, 255, 0.2) 42%,
    rgba(255, 255, 255, 0.95) 50%,
    rgba(170, 210, 240, 0.45) 58%,
    transparent 68%,
    transparent 100%
  );
  background-repeat: no-repeat;
  background-size: 42% 180%;
  background-position: -60% 50%;
  mix-blend-mode: overlay;
  opacity: 0;
  animation: shine-logo 5.2s ease-in-out infinite;
  -webkit-mask-image: url("/logo.png");
  mask-image: url("/logo.png");
  mask-mode: alpha;
  -webkit-mask-mode: alpha;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-size: 100% 100%;
  -webkit-mask-size: 100% 100%;
  mask-position: center;
  -webkit-mask-position: center;
}
.logo-link::after {
  top: 8px;
  bottom: 8px;
  right: 10px;
  left: 10px;
}
.alu-page .alu-brand::after {
  top: 8px;
  bottom: 8px;
  right: 12px;
  left: 12px;
}

/* ציפה והברקה רק כשהרכיב במסך; בעמוד מוסתר הכל נעצר */
html.js-motion .calc-tiles .calc-open:not(.is-onscreen),
html.js-motion .calc-tiles .calc-open:not(.is-onscreen)::after,
html.js-motion .index-tile:not(.is-onscreen),
html.js-motion .contact-cta:not(.is-onscreen),
html.js-motion .contact-cta:not(.is-onscreen)::after,
html.js-motion .logo-link:not(.is-onscreen)::after,
html.js-motion .alu-page .alu-brand:not(.is-onscreen)::after,
html.js-motion .alu-result-card:not(.is-onscreen)::after {
  animation: none;
}
html.page-hidden .site-halo,
html.page-hidden .calc-tiles .calc-open,
html.page-hidden .calc-tiles .calc-open::after,
html.page-hidden .index-tile,
html.page-hidden .contact-cta,
html.page-hidden .contact-cta::after,
html.page-hidden .logo-link::after,
html.page-hidden .alu-page .alu-brand::after,
html.page-hidden .alu-result-card::after {
  animation-play-state: paused !important;
}


.alu-nav a,
.tmh-crumbs a,
.page-shell a {
  display: inline-block;
  transition: transform 0.2s ease;
}
.alu-nav a:hover,
.alu-nav a:focus-visible,
.tmh-crumbs a:hover,
.tmh-crumbs a:focus-visible,
.page-shell a:hover,
.page-shell a:focus-visible,
.site-footer a:hover,
.site-footer a:focus-visible,
.alu-foot a:hover,
.alu-foot a:focus-visible {
  transform: translateY(-2px);
}

.gloss summary,
.alu-explain summary,
.alu-rates summary,
.tmh-yearly summary {
  transition: transform 0.2s ease;
}
.gloss summary:hover,
.alu-explain summary:hover,
.alu-rates summary:hover,
.tmh-yearly summary:hover {
  transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
  .logo-link,
  .alu-page .alu-brand,
  .alu-nav a,
  .tmh-crumbs a,
  .page-shell a,
  .site-footer a,
  .alu-foot a,
  .gloss summary,
  .alu-explain summary,
  .alu-rates summary,
  .tmh-yearly summary {
    transition: none !important;
    transform: none !important;
  }
}
