/* ===== Theme ===== */
:root{
  --bg-0:#04120a; --bg-1:#071d12; --grid:#0e2b1a;
  --txt:#e7f7ee; --muted:#9be6bd; --accent:#22c55e; --accent-2:#86efac;
  --glass: rgba(15,54,33,.45); --radius:18px; --shadow:0 20px 60px rgba(0,0,0,.45);
}
*{box-sizing:border-box} html,body{height:100%}
body{
  margin:0; font-family:Inter,system-ui,Segoe UI,Roboto,Arial,sans-serif; color:var(--txt);
  background: radial-gradient(1200px 600px at 20% -10%, #0a2d1a 0%, transparent 60%),
              radial-gradient(1000px 800px at 110% 0%, #0a411f 0%, transparent 55%),
              linear-gradient(180deg, var(--bg-0), var(--bg-1));
  line-height:1.6;
}
.bg-grid{position:fixed;inset:0;pointer-events:none;opacity:.25;
  background:linear-gradient(transparent 31px,#0e2b1a 32px) 0 0/32px 32px,
             linear-gradient(90deg,transparent 31px,#0e2b1a 32px) 0 0/32px 32px;
  mask-image: radial-gradient(1200px 700px at 50% -20%, black, transparent 70%); z-index:0;
}
section,header,footer{position:relative;z-index:1}
section{padding:clamp(28px,4vw,56px) 18px}
h1,h2,h3,h4{margin:0 0 10px;line-height:1.15} p{margin:0 0 12px}

/* ===== Header: Desktop ===== */
.site-header{
  padding:12px 14px;
  border-bottom:1px solid rgba(134,239,172,.18);
  background: linear-gradient(180deg, rgba(9,32,19,.8), rgba(7,26,16,.55));
  backdrop-filter: blur(8px);
  position: sticky; top:0; z-index:10;
}
.header-grid{
  display:flex; align-items:center; justify-content:space-between;
  gap:16px; min-height:56px;
}
.brand{ display:flex; align-items:center; gap:12px; min-width:0 }
.logo{ width:44px; height:44px; flex:0 0 44px; filter:drop-shadow(0 0 8px rgba(34,197,94,.35)) }
.title-wrap{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; min-width:0 }
.site-title{
  margin:0; font-size:clamp(18px, 2.4vw, 28px); font-weight:800; letter-spacing:.3px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:100%;
}
.site-subtitle{
  font-weight:800; font-size:clamp(12px, 1.7vw, 16px);
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  -webkit-background-clip:text; background-clip:text; color:transparent;
  white-space:nowrap;
}
.contact{
  display:flex; align-items:center; gap:12px; flex-wrap:wrap; justify-content:flex-end;
  font-weight:600; font-size:clamp(12px, 1.6vw, 14px); color:var(--muted);
  min-width:0; text-align:right; overflow-wrap:anywhere; word-break:break-word;
}
.sep{ opacity:.35 }

/* ===== Hero ===== */
.hero{
  padding: clamp(36px, 7vw, 90px) 18px;
  text-align:center; display:flex; justify-content:center; align-items:center;
}
.hero-title{
  font-weight:800; font-size:clamp(28px, 4.5vw, 56px);
  letter-spacing:.2px; margin:0 auto; max-width:90%;
}
.accent{
  background: linear-gradient(90deg, #bbf7d0, #22c55e);
  -webkit-background-clip:text; background-clip:text; color:transparent;
  text-shadow: 0 0 18px rgba(34,197,94,.25);
}

/* ===== About (make container width match Projects) ===== */
.frame.about{
  max-width:1200px;               /* כמו .projects */
  margin-inline:auto;
  padding: 10px 18px 50px;        /* כמו .projects */
}
.frame.about .sheet-about{
  display:grid; gap:24px; align-items:center;
  padding: clamp(14px, 2vw, 20px);
  border-radius: calc(var(--radius) + 6px);
  background: linear-gradient(180deg, rgba(19,53,33,.65), rgba(8,34,19,.65));
  box-shadow: var(--shadow); border:1px solid rgba(134,239,172,.2);
  grid-template-columns: 1.2fr 1.2fr;
}
.copy h3{ font-size: clamp(20px, 2.4vw, 28px); font-weight:800 }
.copy p{ color:#d1f7df; font-size: clamp(14px, 1.6vw, 18px) }
.chips{ display:flex; gap:10px; flex-wrap:wrap; margin-top:14px }
.chips span{ font-weight:700; font-size:14px; padding:8px 12px; border-radius:999px; color:#052e1a; background:#a7f3d0 }

/* About: image stays RIGHT on desktop */
.sheet-about .copy{ order:1 }
.sheet-about .shot{ order:2 }
@media (max-width:860px){
  .frame.about .sheet-about{ grid-template-columns:1fr }
  .sheet-about .copy{ order:2 }
  .sheet-about .shot{ order:1 }
}

/* About image: round & smaller */
.shot{ margin:0 }
.shot img{
  width:100%; height:auto; max-width:250px; aspect-ratio:1/1; object-fit:cover;
  border-radius:50%; display:block; margin-left:auto; margin-right:auto;
  box-shadow:0 10px 40px rgba(0,0,0,.35); border:3px solid rgba(134,239,172,.5);
}

/* ===== Projects ===== */
.projects{ max-width:1200px; margin-inline:auto; padding: 10px 18px 50px }
.section-head h3{ font-size: clamp(22px, 2.4vw, 30px); font-weight:800; margin-bottom:16px }

.cards{ display:grid; gap:22px; grid-template-columns: repeat(12, 1fr) }
.card{
  grid-column: span 12; background: rgba(9,36,22,.6);
  border:1px solid rgba(134,239,172,.18); border-radius: var(--radius);
  overflow:hidden; box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.cards a.card{ display:block; text-decoration:none; color:inherit; }
.card:hover{ transform: translateY(-6px); border-color: rgba(134,239,172,.38); box-shadow: 0 28px 80px rgba(0,0,0,.55) }
.thumb{ aspect-ratio:16/9; overflow:hidden } .thumb img{ width:100%; height:100%; object-fit:cover; display:block }
.card-body{ padding:16px 16px 20px }
.pill{ display:inline-block; font-weight:800; font-size:12px; color:#052e1a; background:#86efac; padding:6px 10px; border-radius:999px }
.card-title{ margin:8px 0 6px; font-weight:800; font-size: clamp(18px, 2.2vw, 22px) }
.card p{ color:#d6ffe8 }

/* 3 כרטיסים בשורה בדסקטופ */
@media (min-width:860px){ .cards .card{ grid-column: span 4 } }

/* ===== Footer ===== */
.site-footer{
  text-align:center; padding:24px 12px; color:var(--muted);
  border-top:1px solid rgba(134,239,172,.18);
  background: linear-gradient(180deg, rgba(8,30,18,.65), rgba(7,22,14,.5));
}

/* ===== Reveal on scroll ===== */
.reveal{ opacity:0; transform: translateY(18px) scale(.98); filter: blur(4px) }
.reveal.revealed{ opacity:1; transform: translateY(0) scale(1); filter:none;
  transition: opacity .7s ease, transform .7s ease, filter .7s ease }

/* ===== Sheen effect on subtitle ===== */
.site-subtitle{
  position:relative; display:inline-block; overflow:hidden;
  font-weight:800; font-size:clamp(12px,1.7vw,16px);
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  -webkit-background-clip:text; background-clip:text; color:transparent;
}
.site-subtitle::before{
  content:""; position:absolute; top:0; left:-75%; width:50%; height:100%;
  background:linear-gradient(120deg, transparent 0%, rgba(255,255,255,.8) 50%, transparent 100%);
  transform:skewX(-25deg); animation:sheen 10s infinite;
}
@keyframes sheen{ 0%{left:-75%} 50%{left:125%} 100%{left:125%} }

/* ===== Mobile Layout (ROW 1: brand | button, ROW 2: menu) ===== */
.contact-btn{ display:none }   /* לא מוצג בדסקטופ כברירת מחדל */

@media (max-width:900px){
  .desktop-contact{ display:none }   /* מסתיר שורת קשר הרגילה */
  .sep{ display:none }

  /* Grid: עמודה שמאל = מותג, עמודה ימין = כפתור; שורה שניה = תפריט */
  .header-grid{
    display:grid;
    grid-template-columns: 1fr auto;
    grid-auto-rows:auto;
    align-items:center;
    gap:8px 10px;
  }

  /* שורה ראשונה: מותג משמאל */
  .brand{ grid-column:1/2; min-width:0; display:flex; align-items:center; gap:8px }
  .title-wrap{ flex-wrap:wrap; gap:4px }
  .site-title, .site-subtitle{ white-space:normal; font-size:14px }

  /* שורה ראשונה: כפתור מימין */
  .contact-btn{
    grid-column:2/3; justify-self:end; display:block;
    background:var(--accent); color:#fff;
    border:none; border-radius:8px; font-weight:800;
    padding:6px 12px; cursor:pointer;
  }
  .contact-btn:active{ transform:translateY(1px) }

  /* שורה שניה: תפריט פתיחה */
  .contact-menu{
    grid-column:1 / -1; display:none; width:100%;
    flex-direction:column; gap:6px;
    background: linear-gradient(180deg, rgba(9,32,19,.9), rgba(7,26,16,.85));
    border:1px solid rgba(134,239,172,.25);
    padding:12px 14px; border-radius:10px; margin-top:4px;
    box-shadow:0 8px 24px rgba(0,0,0,.45);

    font-family: Inter, system-ui, Segoe UI, Roboto, Arial, sans-serif;
    font-size:14px; font-weight:600; color:var(--muted);
  }
  .contact-menu.open{ display:flex }
}

/* כותרות הכרטיסים: איזון שורות יפה */
.card-title{
  text-wrap: balance;           /* מאזנת שורות בכותרות (כרום/ספארי/Edge חדשים) */
  line-height: 1.2;
  margin: 8px 0 6px;
}

/* פסקאות בכרטיסים: שבירה חכמה והיפנים */
.card .card-body p{
  text-wrap: pretty;            /* מפחית "יתומות" ומרווחים מוזרים בסוף שורה */
  hyphens: auto;                /* היפנים אוטומטי (מבוסס lang="en") */
  overflow-wrap: anywhere;      /* אם חייבים – מותר לשבור מילים ארוכות מאוד */
  line-height: 1.45;
}

/* גוף הכרטיס – שיהיה מסודר אנכית */
.card-body{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== Tech Pill (SQL, PYTHON וכו') ===== */
.pill{
  display: inline-block;     /* תופס רק לפי תוכן */
  width: auto;               /* לא מתרחב */
  max-width: max-content;    /* מונע מתיחה מיותרת */
  font-weight:800;
  font-size:12px;
  color:#052e1a;
  background:#86efac;
  padding:6px 10px;
  border-radius:999px;
  white-space:nowrap;        /* לא נשבר לשתי שורות */
}

.bounce {
  display:inline-block;
  animation: bounce 3s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
  60% { transform: translateY(-3px); }
}

@media (max-width: 600px){
  .hero-title{
    white-space: nowrap;                 /* לא לשבור שורה */
    font-size: clamp(12px, 5vw, 20px);   /* 👈 תמיד מתאים למסך */
    line-height: 1.2;
    max-width: 100%;                     /* לא גולש */
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.character {
  position: fixed;
  bottom: 20px;
  right: -250px;   /* מתחיל מחוץ למסך */
  display: flex;
  align-items: flex-end;
  gap: 10px;
  animation: slideIn 2s forwards 1s; /* נכנס אחרי שנייה */
  z-index: 50;
}
/* דמות צמודה לימין */
.character {
  position: fixed;
  bottom: 20px;
  right: 0;
  display: flex;
  flex-direction: row-reverse;  /* דמות מימין, בועה משמאלה */
  align-items: center;          
  gap: 2px;                     /* 👈 עכשיו ממש קרוב לדמות */
  z-index: 1000;
  animation: slideIn 1s forwards;
}


@keyframes character-slide-in{
  from { transform: translateX(120%); }
  to   { transform: translateX(0); }
}

/* תמונה */
.character img{
  width: 120px;
  height: auto;
  display: block;
}


.speech {
  position: relative;
  background: linear-gradient(180deg, rgba(9,32,19,.9), rgba(7,26,16,.85));
  color: var(--txt);
  padding: 14px 18px;
  border-radius: 20px;           
  box-shadow: 0 4px 12px rgba(0,0,0,.4);
  font-size: 14px;
  line-height: 1.4;

  max-width: 240px;
  min-height: 50px;              /* 👈 גובה מינימלי יפה */
  white-space: normal;           
  word-wrap: break-word;

  display: flex;                 /* 👈 מרכז את הטקסט */
  align-items: center;           /* אנכית */
  justify-content: center;       /* אופקית */
  text-align: center;            /* אם ירד לשתי שורות */
}

/* חץ קטן לדמות */
.speech::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -8px;                   /* 👈 יותר קרוב לדמות */
  transform: translateY(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: transparent transparent transparent rgba(9,32,19,.9);
}

/* כפתור X מעל הראש של הדמות */
.close-btn{
  position: absolute;
  top: -30px;         /* מעל לראש */
  right: 20px;        /* בצד ימין */
  background: #22c55e;
  color: #04120a;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

/* אופציונלי: להסתיר במובייל מאוד צר אם חופף תוכן */
@media (max-width: 360px){
  .character img{ width: 96px; }
  .speech{ max-width: 180px; font-size: 13px; }
}
