/* Nav + hero: full-bleed name across the top, the 3D head popping over it */
.nav {
  position: fixed; inset-inline: 0; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px var(--gutter);
  transition: background .4s, backdrop-filter .4s, padding .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled { background: rgba(8, 8, 10, .7); backdrop-filter: blur(16px) saturate(1.4); padding-block: 10px; border-color: var(--line-soft); }
.nav__logo { font-family: var(--f-display); font-size: 1.25rem; font-weight: 900; letter-spacing: -.02em; }
.nav__links { display: flex; gap: clamp(18px, 4vw, 70px); font-size: .78rem; font-weight: 700; letter-spacing: .14em; }
.nav__links a { opacity: .7; transition: opacity .25s; position: relative; }
.nav__links a::after { content: ""; position: absolute; inset-inline: 0; bottom: -4px; height: 1.5px; background: var(--grad); transform: scaleX(0); transition: transform .35s var(--ease-out); }
.nav__links a:hover { opacity: 1; }
.nav__links a:hover::after { transform: scaleX(1); }
.nav .pill { padding: .55em 1.2em; font-size: .85rem; }
@media (max-width: 760px) { .nav__links { display: none; } }

.hero {
  min-height: auto;
  padding: 74px 0 40px;
  overflow: hidden;
  isolation: isolate;
  display: flex; flex-direction: column;
}
/* fine grain over the whole hero for a premium, less "flat" black */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .08; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero__title {
  font-size: min(17.2vw, 32vh);
  text-align: center; white-space: nowrap;
  position: relative; z-index: 1;
  color: #e9e9ee;
  margin-top: 1vh;
}
.hero__title .word { display: inline-block; opacity: 0; transform: translateY(40%); filter: blur(10px); animation: wordIn 1.1s var(--ease-out) forwards; animation-delay: var(--d); }
@keyframes wordIn { to { opacity: 1; transform: none; filter: none; } }

.hero__stage { position: relative; display: flex; justify-content: center; align-items: flex-start; margin-top: calc(min(17.2vw, 32vh) * -.45); }

/* The 3D head overlaps the bottom of the title */
.hero__head { position: relative; z-index: 2; width: min(31vw, 50vh); pointer-events: none; }
.hero__head-pop { animation: headPop 1.2s var(--ease-spring) .5s both; }
/* whole head sways side to side (rocks from its chin) with a light bob */
.hero__head-float { transform-origin: 50% 85%; animation: sway 4.2s ease-in-out 1.7s infinite; }
/* 3D tilt toward the cursor is applied to the whole character (video or still) */
.hero__head .char {
  transform: perspective(900px) rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)) translate(var(--tx, 0px), var(--ty, 0px));
  transition: transform .6s var(--ease-out);
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .55));
}
@keyframes headPop { from { opacity: 0; transform: scale(.35) translateY(40%); } to { opacity: 1; transform: none; } }
@keyframes sway {
  0%, 100% { transform: translateX(0) rotate(0deg); }
  25% { transform: translateX(-4%) translateY(-8px) rotate(-7deg); }
  50% { transform: translateX(0) translateY(0) rotate(0deg); }
  75% { transform: translateX(4%) translateY(-8px) rotate(7deg); }
}

.hero__side {
  position: absolute; z-index: 3; top: 22%;
  max-width: 300px; font-size: .92rem; line-height: 1.55; color: var(--ink-dim);
  opacity: 0; animation: wordIn 1s var(--ease-out) 1.2s forwards;
}
.hero__side strong { color: var(--ink); display: block; font-size: 1rem; margin-bottom: 4px; }
/* text + button sit just right of the head (head half-width + gap), never over it */
.hero__side--start {
  --head-half: min(15.5vw, 25vh);
  left: calc(50% + var(--head-half) + 72px);
  width: min(320px, calc(50% - var(--head-half) - 72px - var(--gutter)));
  max-width: none;
}
.hero__side p { margin: 0; }
.hero__cta { margin-top: 20px; }
.hero__side small { display: block; margin-top: 12px; letter-spacing: .12em; font-size: .72rem; }

/* Phones/tablets: stack title, head, text in normal flow */
@media (max-width: 900px) {
  .hero { min-height: auto; padding: 86px 0 36px; }
  /* two big lines on phones: "היי, אני" / "לינוי" */
  .hero__title { font-size: 26vw; white-space: normal; line-height: .82; margin-top: 2vh; padding-inline: 10px; }
  .hero__title .word:nth-child(3) { display: block; }
  .hero__title { position: relative; z-index: 3; }
  .hero__stage { flex-direction: column; align-items: center; margin-top: -3vw; }
  .hero__head { width: min(62vw, 300px); order: -1; }
  .hero__side { position: static; text-align: center !important; max-width: 420px; margin: 18px auto 0; padding-inline: var(--gutter); }
  .hero__side--start { width: auto; left: auto; }
}
