/* =========================================================
   התאמה לכל המכשירים: טלפונים (קטנים וגדולים), טלפונים אופקיים,
   אייפד בכל הגדלים וטאבלטים. גלילה טבעית, בלי חיתוך תוכן.
   רמות:  ≤639  טלפון צר  |  640–899  טאבלט וטלפון אופקי  |  900+  מסכים גדולים (מגע: גלילה טבעית)
   ========================================================= */

/* ---------- כל מכשיר מגע: בלי snap (הוא חותך תוכן כשעוצרים באמצע), ואזורי לחיצה נוחים ---------- */
@media (hover: none), (pointer: coarse), (max-width: 899px) {
  html { scroll-snap-type: none !important; }
}
@media (pointer: coarse) {
  :root { --top-h: 72px; }
  .car-idx button { min-height: 44px; min-width: 40px; display: inline-grid; place-items: center; padding-block: 0 0.3rem; }
  .faq-q { min-height: 52px; }
  .scroll-cue small { font-size: 0.72rem; }
  .side-label span, .ab-label { font-size: 0.74rem; }
}

/* ---------- כותרת: מתחת ל-1024px התפריט הופך להמבורגר ---------- */
@media (max-width: 1023px) {
  .top { justify-content: space-between; }
  .top-cta, .nav { display: none; }
  .menu-btn { display: grid; }
}

/* =========================================================
   עד 899px: פריסות מכווצות
   ========================================================= */
@media (max-width: 899px) {
  :root { --top-h: 60px; --pad-x: clamp(16px, 5vw, 40px); }

  .logo img { height: 40px; }
  .scene { min-height: 100svh; padding: calc(var(--top-h) + 14px) var(--pad-x) 66px; justify-content: center; }
  .s-head { margin-bottom: 18px; }
  .s-title { font-size: clamp(1.9rem, 8vw, 2.9rem); line-height: 1.12; }
  .s-sub { font-size: 0.95rem; line-height: 1.6; }
  .eyebrow { letter-spacing: 0.3em; font-size: 0.75rem; }

  /* ---------- HUD ווואטסאפ ---------- */
  .hud-count { display: none; }
  .hud { padding: 6px 10px; bottom: 10px; gap: 8px; }
  .hud-seg { gap: 3px; }
  .hud-seg button { width: 16px; }
  .hud-seg button span { display: none; }
  .wa { width: 46px; height: 46px; left: 12px; bottom: 12px; }
  .wa svg { width: 23px; height: 23px; }

  /* ---------- בית ---------- */
  #home { min-height: 100svh; }
  .home-grid {
    grid-template-columns: 1fr; height: auto; min-height: 100svh; align-content: center; justify-items: center; text-align: center;
    gap: clamp(10px, 2.4svh, 22px); padding: calc(var(--top-h) + 8px) var(--pad-x) 62px;
  }
  .scroll-cue { display: none; }
  .home-ghost { left: -48vw; top: 14svh; width: 170vw; height: 227vw; opacity: 0.55; filter: blur(16px) brightness(0.6) saturate(1.7) sepia(0.25); }
  .photo-stage { margin: 0; justify-self: center; }
  .photo { width: min(58vw, 28svh, 300px); outline-offset: 2px; }
  .home-text { display: grid; justify-items: center; justify-self: center; max-width: 30rem; }
  .h1 { font-size: clamp(2.4rem, 12.5vw, 4rem); }
  .home-lead { font-size: 1rem; max-width: 22rem; margin-top: clamp(10px, 2svh, 20px); }
  .home-text .btn { width: 100%; max-width: 320px; justify-content: center; margin-top: clamp(12px, 2.6svh, 24px); }

  /* ---------- שירותים: קרוסלה קלה לגלילה מהצדדים ---------- */
  .svc-grid {
    width: auto;
    display: flex; gap: 14px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin-inline: calc(var(--pad-x) * -1); padding: 6px var(--pad-x) 12px; scroll-padding-inline: var(--pad-x); touch-action: pan-x pan-y;
  }
  .svc-grid::-webkit-scrollbar { display: none; }
  .svc { flex: 0 0 min(70vw, 285px); scroll-snap-align: center; scroll-snap-stop: always; }
  .svc-img { height: clamp(110px, 17svh, 170px); }
  .svc-body { padding: 0 16px 16px; }
  .svc .num { font-size: 1.9rem; margin-bottom: 0.3rem; }
  .svc h3 { font-size: 1.15rem; }
  .svc p { font-size: 0.92rem; margin: 0.5rem 0 0.9rem; }
  .svc .act { font-size: 1rem; }
  .svc-dots { display: flex; justify-content: center; gap: 8px; margin-top: 4px; }
  .svc-dots button { width: 9px; height: 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.25); transition: width 0.3s var(--ease), background 0.3s; padding: 0; }
  .svc-dots button::after { content: ''; position: absolute; inset: -18px -6px; }
  .svc-dots button { position: relative; }
  .svc-dots button.is-on { width: 26px; background: var(--orange); }

  /* ---------- כך אני עובדת: מסודר לפי הספרות מלמעלה למטה (בלי קרוסלה) ---------- */
  .proc-grid { display: grid; grid-template-columns: 1fr; gap: 12px; overflow: visible; margin: 0; padding: 0; }
  .proc { padding: 54px 18px 14px; flex: none; }
  .proc .num { top: 12px; right: 18px; font-size: 1.9rem; }
  .proc h3 { font-size: 1.12rem; }
  .proc p { font-size: 0.95rem; margin: 0.45rem 0 0.8rem; }
  .proc .act { min-height: 44px; display: flex; align-items: center; padding-top: 0.6rem; }

  /* ---------- דברים שדמיינתי ואז בניתי: קרוסלה קטנה ונוחה לקריאה ---------- */
  #work { --car-h: clamp(300px, 44svh, 380px); }
  .side-label { display: none; }
  .car { margin-inline: calc(var(--pad-x) * -1); margin-top: 6px; }
  .car-card {
    width: min(84%, 380px); flex-direction: column-reverse;
    transform: translateX(calc(-50% + var(--o) * 92%)) translateZ(calc(var(--ao) * -80px)) rotateY(calc(var(--o) * -8deg)) scale(calc(1 - var(--ao) * 0.06));
  }
  .car-img { flex: 0 0 40%; -webkit-mask-image: linear-gradient(0deg, transparent, #000 28%); mask-image: linear-gradient(0deg, transparent, #000 28%); }
  .car-text { flex: 1; padding: 10px 18px 16px; justify-content: flex-start; }
  .car-text .dash { display: none; }
  .car-text .num { position: absolute; top: 8px; inset-inline-end: 16px; font-size: 0.85rem; }
  .car-text p { margin: 0.35rem 0 0.7rem; font-size: 0.92rem; line-height: 1.4; }
  .car-text .btn { padding: 0.6rem 1.1rem; font-size: 0.88rem; }
  .pname { font-size: 1.6rem; }
  .car-arrow { display: none; }
  .car-bar { grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding-inline: 0; margin-top: 10px; }
  .car-nextbtn span:first-child { display: none; }
  .car-idx { gap: 0.4rem; }

  /* ---------- נעים להכיר: התמונה לצד הכותרת, כל הטקסט מתחת, בלי להשמיט כלום ---------- */
  .about-grid { grid-template-columns: minmax(0, 34%) minmax(0, 1fr); grid-template-areas: 'photo eye' 'photo ttl' 'copy copy' 'note note' 'tag tag'; gap: 8px 16px; align-items: start; }
  .about-text { display: contents; }
  .about-visual { grid-area: photo; order: 0; width: 100%; max-width: 190px; justify-self: center; align-self: start; }
  .about-text .eyebrow { grid-area: eye; align-self: end; }
  .about-text .s-title { grid-area: ttl; font-size: clamp(1.8rem, 8vw, 2.6rem); margin: 0; align-self: start; }
  .about-text .s-title::after { margin-top: 12px; }
  .about-copy { grid-area: copy; margin-top: 12px; }
  .about-note { grid-area: note; margin-top: 4px; }
  .about-tag { grid-area: tag; justify-self: start; }
  .about-copy p { font-size: 0.98rem; line-height: 1.7; margin-bottom: 0.7rem; }
  .about-copy p:first-child { font-size: 1.08rem; }
  .ab-label, .ab-dot { display: none; }
  .ab-frame { outline-offset: 5px; }

  /* ---------- שאלות נפוצות: הכותרת למעלה, אחריה כל השאלות, ובסוף "לא מצאתם?" ---------- */
  .faq-grid { display: flex; flex-direction: column; gap: 10px; }
  .faq-side { display: contents; }
  .faq-side > * { order: 0; }
  .faq-list { order: 1; margin-top: 8px; }
  .help-card { order: 2; display: flex; max-width: none; margin-top: 10px; }
  .faq-title { font-size: clamp(2.4rem, 11vw, 3.6rem); margin: 0.4rem 0 0.5rem; }
  .faq-lead { margin-bottom: 4px; font-size: 0.98rem; }
  .faq-q { padding-block: 6px; }
  .qt { font-size: 1rem; line-height: 1.35; }
  .bn { width: 34px; height: 34px; font-size: 0.85rem; }
  .faq-a p { font-size: 0.96rem; padding-inline-start: clamp(14px, 4vw, 22px); }

  /* ---------- צור קשר ---------- */
  .contact-grid { grid-template-columns: 1fr; gap: 20px; }
  .cinfo { order: -1; }
  .cinfo .c-title { font-size: clamp(2.2rem, 10.5vw, 3.4rem); margin: 0.5rem 0 0.7rem; }
  .c-lead { font-size: 1rem; }
  .cform { padding: 20px 16px; border-radius: 22px; }
  .fld input, .fld select, .fld textarea { font-size: 16px; min-height: 48px; }
  .fld textarea { min-height: 110px; }
  .frow { grid-template-columns: 1fr; }
  .follow { max-width: none; margin-top: 12px; }
  .fsoc a { width: 46px; height: 46px; }
  .legal { position: static; text-align: center; margin-top: 22px; }
}

/* ---------- טלפון קטן / גובה נמוך ---------- */
@media (max-width: 899px) and (max-height: 640px) and (orientation: portrait) {
  .photo { width: min(50vw, 24svh); }
  .h1 { font-size: clamp(2.1rem, 10.5vw, 3rem); }
  .svc-img { height: 96px; }
  .about-visual { max-width: 150px; }
}
@media (max-width: 359px) {
  .s-title { font-size: 1.75rem; }
  .svc { flex-basis: 78vw; }
  .car-card { width: 90%; }
  .about-grid { gap: 8px 12px; }
}

/* =========================================================
   640–899px: טאבלט (אייפד מיני וקטן) וטלפון אופקי: שתי עמודות
   ========================================================= */
@media (min-width: 640px) and (max-width: 899px) {
  :root { --pad-x: clamp(24px, 4.4vw, 44px); }

  /* בית: התמונה בצד, הטקסט לידה */
  .home-grid { grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: start; gap: clamp(24px, 5vw, 56px); align-content: center; }
  .photo-stage { justify-self: center; }
  .photo { width: min(38vw, 46svh, 330px); }
  .home-text { justify-items: start; justify-self: start; max-width: none; }
  .h1 { font-size: clamp(2.6rem, min(7vw, 13svh), 4.6rem); }
  .home-text .btn { width: auto; max-width: none; }

  /* שירותים: כמעט שלושה כרטיסים על המסך */
  .svc { flex-basis: min(36vw, 300px); }
  .svc-img { height: clamp(120px, 20svh, 190px); }

  /* תהליך: שתי עמודות, ממוספרות מלמעלה למטה בכל עמודה */
  .proc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, auto); grid-auto-flow: column; gap: 14px; }

  /* עבודות: כרטיס אופקי, חיצים */
  #work { --car-h: clamp(250px, 42svh, 320px); }
  .car-card { width: min(70%, 560px); flex-direction: row; }
  .car-img { flex: 1; -webkit-mask-image: linear-gradient(90deg, transparent, #000 24%); mask-image: linear-gradient(90deg, transparent, #000 24%); }
  .car-text { flex: 0 0 44%; padding: 16px 18px; justify-content: center; }
  .car-text .num { position: static; font-size: 0.95rem; }
  .car-text .dash { display: block; }
  .car-arrow { display: grid; width: 46px; height: 46px; margin-top: -23px; }
  .car-bar { grid-template-columns: auto minmax(0, 1fr) auto; }
  .car-nextbtn span:first-child { display: inline; }

  /* אודות: תמונה לצד הטקסט, כמו במחשב */
  .about-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.8fr); grid-template-areas: none; gap: 28px; align-items: center; }
  .about-text { display: block; }
  .about-text .eyebrow, .about-text .s-title, .about-copy, .about-note, .about-tag, .about-visual { grid-area: auto; }
  .about-text .s-title { font-size: clamp(2.1rem, 5.6vw, 3.2rem); margin-bottom: 14px; }
  .about-copy { margin-top: 0; }
  .about-visual { max-width: 270px; width: 100%; justify-self: center; align-self: start; position: sticky; top: calc(var(--top-h) + 14px); }

  /* שאלות: עמודה לכותרת ועמודה לרשימה */
  .faq-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
  .faq-side { display: block; position: sticky; top: calc(var(--top-h) + 14px); }
  .faq-list { order: 0; margin-top: 0; }
  .help-card { order: 0; }
  .faq-title { font-size: clamp(2.4rem, 7vw, 3.8rem); }

  /* קשר: טופס לצד הכותרת */
  .contact-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 28px; align-items: center; }
  .cinfo { order: 0; }
  .cinfo .c-title { font-size: clamp(2.2rem, 6vw, 3.4rem); }
  .frow { grid-template-columns: 1fr 1fr; }
}

/* =========================================================
   טלפון אופקי (גובה נמוך): הכול דחוס יותר, התמונה "דביקה" בצד
   ========================================================= */
@media (max-height: 520px) and (orientation: landscape) {
  :root { --top-h: 54px; }
  .logo img { height: 36px; }
  .scene { padding-top: calc(var(--top-h) + 10px); padding-bottom: 56px; }
  .s-head { margin-bottom: 12px; }
  .s-title { font-size: clamp(1.7rem, 4.6vw, 2.4rem); }
  .home-grid { padding-top: calc(var(--top-h) + 4px); padding-bottom: 52px; grid-template-columns: auto minmax(0, 1fr); justify-items: start; text-align: start; }
  .photo { width: min(30vw, 56svh * 0.75, 300px); }
  .home-text { justify-items: start; }
  .h1 { font-size: clamp(2rem, min(6vw, 14svh), 3.4rem); }
  .home-lead { font-size: 0.95rem; max-width: 24rem; }
  .home-text .btn { width: auto; max-width: none; }
  .scroll-cue { display: none; }
  .svc-img { height: 84px; }
  .svc { flex-basis: min(32vw, 260px); }
  .about-visual { max-width: min(30vw, 190px); position: sticky; top: calc(var(--top-h) + 10px); }
  .wa { bottom: 10px; }
  .hud { display: none; }
}

/* תפריט בטלפון אופקי: פריטים קומפקטיים כדי שכולם ייכנסו */
@media (max-height: 520px) {
  .menu li a { min-height: 40px; padding-block: 0.3rem; font-size: 1rem; }
  .menu-cta { padding-block: 0.6rem; }
  .menu-foot { padding-block: 4px 2px; }
}

/* קרוסלת העבודות בטלפון: סרגל הניווט לא מוסתר מאחורי כפתור הוואטסאפ הצף */
@media (max-width: 639px) {
  .car-bar { grid-template-columns: minmax(0, 1fr) auto; padding-inline-start: 0; padding-left: 64px; gap: 10px; }
  .car-progress { display: none; }
  .car-idx { gap: 0.1rem; }
}


/* ===== מובייל וטאבלט (עד 1023px): לוגו משמאל והמבורגר מימין, תפריט נפתח מימין ===== */
@media (max-width: 1023px) {
  .menu-btn { order: -1; }
  .logo { order: 2; }
  .menu { left: auto; right: max(12px, env(safe-area-inset-right)); transform-origin: top right; }
}

/* ===== מובייל: וואטסאפ צף גבוה יותר ===== */
@media (max-width: 899px) {
  .wa { bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); }
  .car-bar { padding-left: 0; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .wa { bottom: 22px; }
}
